Hi,
On 23/12/10 0:23 , Laith Dhawahir wrote:
> Code:
>
> //if the context was created then attach to our viewer
> if(graphicsContext)
> {
> viewer->getCamera()->setGraphicsContext(graphicsContext);
> // viewer->getCamera()->setViewport(new osg::Viewport(0, 0,
> traits->width, traits->height));
> }
>
> osg::setNotifyLevel(osg::DEBUG_FP);
>
> root = new osg::MatrixTransform();
>
> osg::Geode* geode = new osg::Geode();
> osg::ShapeDrawable* drawable = new osg::ShapeDrawable( new
> osg::Box(osg::Vec3(0,1,1),1));
>
> drawable->setColor(osg::Vec4(1.0f,0.0f,1.0f,0.5f));
> drawable->getOrCreateStateSet();
> geode->addDrawable(drawable);
>
> root->addChild(geode);*/
>
> viewer->setSceneData(root.get());
> viewer->setCameraManipulator(new osgGA::TrackballManipulator);
> viewer->realize();
Since this is just a code fragment it's hard/impossible to get an overall
picture.
For example, the line 'root->addChild(geode)' has a closing comment on it,
which could
mean that the entire block you've sent is commented.
Certainly *not* adding the geode to the scene root would explain why you're not
seeing
anything.
Why don't you post the entire setup function to save us from guessing?
Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org