Hi Michele,
All the component parts required are there in osg::Camera and
osg::Matrix and can be mixed and matched depending upon your needs.
To go from object coords to window you do:
osg::Matrix MVPW = modelmatrix *
camera->getViewMatrix() *
camera->getProjectionMatrix() *
camera->getViewport()->computeWindowMatrix();
osg::Vec window = object * MVPW;
Robert.
On Mon, Apr 21, 2008 at 5:19 PM, Michele Bosi <[EMAIL PROTECTED]> wrote:
> Hello,
> I need to project the mouse coordinates in world coordinates given a
> Camera*, how can I implement this? I expected some "project"/"unproject"
> method similar to gluProject/Unproject in the Camera class or in the Viewer
> or in Matrix but couldn't find anything. Can anyone point me in the right
> direction before I start cut-and-pasting the sourcecode from MESA's
> gluProject()? :)
>
> Thanks,
> Michele
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org