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

Jump to navigation Jump to search
Line 191: Line 191:
</syntaxhighlight>
</syntaxhighlight>


To see if our new SystemAdapter method is working properly, we can simply add it to the constructor of an existing element, e.g.:
<syntaxhighlight lang="cpp">
osg::Node* model = Canvas::getSystemAdapter()->getModel("Models/Geometry/glider.ac");
</syntaxhighlight>


While this will not yet add the model to the scene graph (canvas), we should at least be seeing success/failure messages in the console suggesting if our function works properly (that is, once the corresponding element is added).
Next, we only need to coax our new Canvas element to use said <code>osg::Node</code> object.
Next, we only need to coax our new Canvas element to use said <code>osg::Node</code> object.


Navigation menu