Re: [osg-users] Camera view frustum to Polytope

2010-02-18 Thread Sean McVey
Hi guys, I've been trying to setup my Polytope as my cameras' frustum with no such luck. Robert has the setup changed? I'm using osg 2.8.1. Is this correct? What am I doing wrong? osg::Polytope frustum; frustum.setToUnitFrustum(); frustum.transformProvidingInverse( camera-getViewMatrix() );

Re: [osg-users] Camera view frustum to Polytope

2010-02-18 Thread Simon Hammett
On 18 February 2010 15:13, Sean McVey sean.r.mc...@lmco.com wrote: Hi guys, I've been trying to setup my Polytope as my cameras' frustum with no such luck. Robert has the setup changed? I'm using osg 2.8.1. Is this correct? What am I doing wrong? osg::Polytope frustum;

Re: [osg-users] Camera view frustum to Polytope

2009-05-14 Thread Robert Osfield
Hi Simon, What you need to do is use the Polytope::setToUnitFrustum(..) method to create the eye space -1,1 unit cube, then transform this is to world coordinates by multiplying it by the inverse of the camera's view matrix. It just so happens that there is a

Re: [osg-users] Camera view frustum to Polytope

2009-05-14 Thread Simon Hammett
Thanks Robert :) Put me on the right track. Just for reference if anybody else needs it: osg::Polytope frustum; frustum.setToUnitFrustum(); frustum.transformProvidingInverse( pViewer-getCameraManipulator()-getInverseMatrix() * pViewer-getCamera()-getProjectionMatrix()); 2009/5/14 Robert