Hello,

I have a query relating to setting up cameras in OSG.

 

I am looking to specify a frustum and view offset for my camera. I can
do this in several different ways:

 

 

viewer.addSlave(camera.get(), osg::Matrix::frustum(-1,1,-1,1,3,1000),
osg::Matrix::translate(0.0f,0.0f,-30.0f));

 

OR

 

camera->setProjectionMatrixAsFrustum(-1,1,-1,1,3,1000);

camera->setViewMatrix(osg::Matrix::translate(0.0f,0.0f,-30.0f));

viewer.addSlave(camera.get());

 

OR

 

viewer.addSlave(camera.get()); 

viewer.getCamera()->setProjectionMatrixAsFrustum(-1,1,-1,1,3,1000);

viewer.getCamera()->setViewMatrix(osg::Matrix::translate(0.0f,0.0f,-30.0
f));

 

Only the last of these combinations produces the results I was
expecting. I thought they were equivalent. What am I missing?

 

Thanks,

 

Guy

 

PS I'm running OSG 2.4 under Win XP and on a SGI Octane

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

Reply via email to