Hi,
I have problems with LOD and AutoTransform
I add 2 nodes and displays at a distance, but can not see anything. If closer
to the model, then everything starts to work. If you add only AutoTransform,
everything works. What could be the problem?
Code:
osg::ref_ptr< osg::LOD > lod = new osg::LOD;
osg::ref_ptr<osg::Billboard> billBord = new osg::Billboard();
billBord->setMode(osg::Billboard::POINT_ROT_EYE);
billBord->addDrawable(
createSquare(osg::Vec3(-15.0f,0.0f,-0.5f),osg::Vec3(30.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,30.0f),osgDB::readImageFile("C:\\1.png")),osg::Vec3(0.0f,0.0f,0.0f)
);
osg::ref_ptr<osg::AutoTransform> at = new osg::AutoTransform;
at->setAutoScaleToScreen(true);
at->setMinimumScale( 1.0 );
at->setMaximumScale( 10000.0 );
at->addChild ( billBord.get() );
at->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("C:\\cow.osg");
double radius = model->getBound().radius() ;
lod->addChild( model.get() , 0 , radius * 10 );
lod->addChild( at.get() , radius * 10 , 1000000000 );
...
Thank you!
Cheers,
Alex
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61661#61661
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org