![]() |
VR-Vantage 3.0.3 API Documentation
|
This example shows how to add nodes to the scene graph via a renderer. The plugin loads a geometry file in OpenFlight format and inserts it directly into the scene. Of particular interest in this example is how to gain access to the scene graph in order to insert a node.
The content that this example application displays is a geometry file in OpenFlight format. This application implements a helper function to load the geometry and add the geometry to the scene-graph.
The function accepts a pointer to a display engine (DtDe) where the scene renderer can be found. The display engine passed to this function is passed in by the plugin manager when the plugin is loaded.
The geometry to display is in a file on disk. When the application loads the geometry, a small scene-graph branch is created with a transform node at its root so the geometry can be moved in the scene.
To add the geometry into the VR-Vantage scene, the renderer is retrieved from the display engine and the root-node of the geometry is added to a root of the scene.
In this example, the geometry is placed under the 'propRoot' of the renderer. The renderer is responsible for managing how the scene is rendered. As such, the renderer defines several 'root domains' such as Environment, Terrain, Prop, ModelSets, etc. These domains separate the one scene into 'logical' divisions or groupings. The renderer provides access to these different groupings using an API that abstracts the logical purpose of the geometry from the detailed implementation of the scene-graph.
VR-Vantage includes pre-built versions of the example plug-in. To build it yourself, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.
This example is a plug-in. You can run it by running ./bin64/exampleSceneRootPlugin_stealth.bat (on Windows from cmd.exe) or ./bin64/exampleSceneRootPlugin_stealth.sh (on Linux). For more information about running examples, please see Running Applications and Examples.
[<< Examples] [Home] [Top of Page]