Hi,

Emilio Lozano wrote:
> 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
the model is still clipped...

>     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->culling
OpenGL->clipping

If you want the cow, it'll have to be between the front/back clip planes 
of some camera along the way. E.g. you could draw the cow to a texture 
(it must be in the clipping planes) and paste is over your scene if you 
do not want the cow to influence the clipping of the rest of your scene.

jp

> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to