VR-Vantage 2.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exampleSceneRoot

Table of Contents

Overview

This example shows how to add nodes to the scene graph via a renderer. The application loads a geometry file in OpenFlight format and inserts it directly into the scene. Of particular interest in this example is how to create, initialize and run a VR-Vantage application, and how to gain access to the scene in order to insert a node.

Expected Result

exampleSceneRoot2.png
Scene Root Result

Example details

To create a very basic VR-Vantage application, first instantiate the application, initialize it and finally call run.

... add some content to the application ...

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 reference to a display engine (DtDe) where the scene renderer can be found. The display engine passed to this function is retrieved directly from the application.

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.

Building the Example

VR-Vantage includes pre-built versions of the example application. To build it yourself, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.

Running the Example

This example is an application. You can run it by running ./bin64/exampleSceneRoot.exe (on Windows) or ./bin64/exampleSceneRoot (on Linux). For more information about running examples, please see Running Applications and Examples.

Learn More

Example Source Files


exampleSceneRoot.cxx

[<< Examples] [Home] [Top of Page]



Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)