Hi everyone. I'm trying to calculate the line-of-sight line in world space, which involves mapping from window space. My approach works in principal, however the resulting positions are allways off by a small amount.
Inside a osg::View I have: Matrixd m; m.preMult(getCamera()->getViewport()->computeWindowMatrix()); m.preMult(getCamera()->getProjectionMatrix()); m.preMult(getCamera()->getViewMatrix()); Matrixd inv; inv.invert(m); For example: I exspect Vec3d( winWidth/2, winHeight/2, 0.0 ) * inv ; to yield the camera/eye position. However the x,y,z coords differ in about 0.5% from the eyepos of getCamera()->getViewMatrixAsLookAt(). (Unless the camera is positioned in world origin) Do I miss something? Regards ......Volker _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

