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

Jump to navigation Jump to search
Line 193: Line 193:
To see if our new SystemAdapter method is working properly, we can simply add it to the constructor of an existing element, e.g.:
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">
<syntaxhighlight lang="cpp">
osg::Node* model = Canvas::getSystemAdapter()->getModel("Models/Geometry/glider.ac");
osg::Node* model = Canvas::getSystemAdapter()->getModel("Models/Geometry/glider.ac");
    if(!model)
        SG_LOG(SG_GL, SG_ALERT, "Adapter not working: getModel()");
    else
        SG_LOG(SG_GL, SG_ALERT, "Success, model loaded !");
 
</syntaxhighlight>
</syntaxhighlight>


Navigation menu