Howto:Extending Canvas to support rendering 3D models: Difference between revisions

Jump to navigation Jump to search
Line 30: Line 30:
* The new element will serve as a container for an [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00618.html Osg::PositionAttitudeTransform] (PAT) for positioning the 3D model
* The new element will serve as a container for an [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00618.html Osg::PositionAttitudeTransform] (PAT) for positioning the 3D model
* as a child node, we'll add an [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00642.html Osg::ProxyNode]
* as a child node, we'll add an [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00642.html Osg::ProxyNode]
* the new Canvas element will be monitoring the property tree for '''filename''' events and update the file name accordingly.
* the new Canvas element will be monitoring the property tree for '''filename''' events and update the loaded 3D model accordingly.
* equally, we'll need to expose a few PAT methods to the property tree
* equally, we'll need to expose a few PAT methods to the property tree, so that the model can be transformed/rotated by updating a few properties


The osg::ProxyNode node will reduce the start time of the viewer if there are huge numbers of models to be loaded and displayed in the scene graph. It is able to function as the interface of external files, help applications to start up as soon as possible, and then read those waiting models by using an independent data thread. It uses setFileName() rather than addChild() to set a model file and dynamically load it as a child.[https://www.packtpub.com/books/content/openscenegraph-managing-scene-graph]
The osg::ProxyNode node will reduce the start time of the viewer if there are huge numbers of models to be loaded and displayed in the scene graph. It is able to function as the interface of external files, help applications to start up as soon as possible, and then read those waiting models by using an independent data thread. It uses setFileName() rather than addChild() to set a model file and dynamically load it as a child.[https://www.packtpub.com/books/content/openscenegraph-managing-scene-graph]
Line 78: Line 78:
}
}
</syntaxhighlight>
</syntaxhighlight>


== Extending FGCanvasSystemAdapter ==
== Extending FGCanvasSystemAdapter ==

Navigation menu