Hi all,
I'`m trying to get a node always drawn without being affected by near
clipping plane defined in projection perspective. With the following simple
code what I expected to get is that the cow was not clipped by near or far
planes, but the cow is still clipped.
Could you give me any hints?
Thanks in advance to all.
int main( int argc, char **argv )
{
osg::ArgumentParser arguments(&argc,argv);
osg::Node* loadedModel = osgDB::readNodeFile("cow.osg");
// Although set as not culled, the model is still culled by near/far
planes
loadedModel->setCullingActive (false);
osg::Group* rootnode = new osg::Group();
rootnode->addChild (loadedModel);
// run optimization over the scene graph
osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode);
osgViewer::Viewer viewer;
viewer.setUpViewInWindow (100, 100, 800, 600, 0);
// set the scene to render
viewer.setSceneData(rootnode);
viewer.getCamera ()->setProjectionMatrixAsPerspective (30.0, 40.0 /
30.0, 50.0, 2000.0);
viewer.getCamera ()->setComputeNearFarMode
(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
return viewer.run();
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org