[osg-users] Polytope from view frustum

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Wed Nov 2 03:04:07 PDT 2016


Thanks Robert

On Wed, Nov 2, 2016 at 9:43 AM, Robert Osfield <robert.osfield at gmail.com>
wrote:

> On 1 November 2016 at 21:45, Trajce Nikolov NICK
> <trajce.nikolov.nick at gmail.com> wrote:
> > Hi Community,
> >
> > anyone knowing how to achieve this and with will to share?
> >
> > Thanks a bunch as always !!
>
> Have a look at the API's...
>
> First one to look at is osg::Polytope, create one of these with a unit
> frustum.  This will be in clip space.
>
> Next step transform this Polytope by the projection matrix using the
> transformProvidingInverse() method (to transform a plane you multiple
> it by the inverse of that matrix), so in our case the projection
> matrix transform from eye space into clip space which is the inverse
> of the transform we intend, but thanks to the way that planes are
> transformed we can just use the projection matrix directly as long as
> we use the transformProvidingInverse().  See the src/osg/CullStack.cpp
> to see this in action.
>
> Then transform into object coordinates using the same method by
> providing the view and model matrices.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161102/95342796/attachment-0003.htm>


More information about the osg-users mailing list