update: Code: // get matrices osg::Matrix matrix; matrix.preMult(_tracer->getCamera()->getViewport()->computeWindowMatrix()); matrix.preMult(_tracer->getCamera()->getProjectionMatrix()); matrix.preMult(_tracer->getCamera()->getViewMatrix());
// invert osg::Matrix inverse; inverse.invert(matrix); // set results _startWorldPoint = getStart() * inverse; _endWorldPoint = getEnd() * inverse; ... Code: osg::Vec3d eyeDirection = collisionPoint - _tracer->getEye(); eyeDirection.normalize(); // this vector is correct, but the starting point (the eye) is not sufficient for my application osg::Vec3d newDirection = getReverseDirection(); // _reverseDirectionVector = (getEndWorldPoint() - getStartWorldPoint()).getVectorPart(); newDirection.normalize(); // this vector is slightly different, i suppose the points are not correctly positioned this approach results in similar, but not the same vectors. definitely not correct though, according to visual results. any suggestions? ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46702#46702 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org