Hello again!

I've just realized i do need to be able to translate the starting and ending 
points of a LineSegmentIntersector created in WINDOW coordinate frame into the 
WORLD coordinate space.

is there any simple method to do so ? by retrieving them from the intersector 
or its intersection. i couldn't find any.

my guess is to take matrices, make an inverse and multiply:
Code:
osg::Matrix matrix;
matrix.preMult( somehow.getWindowMatrix() );
matrix.preMult( somehow.getProjectionMatrix() );
matrix.preMult( somehow.getViewMatrix() );
osg::Matrix inverse;
inverse.invert(matrix);

startPointInWorldCoordinates = startPoint * inverse;

but this seems computation-wise lengthy and i am not sure how to get all these 
matrices ... maybe the window matrix from viewport and the other two from 
camera.
but I see this is done in the lineSegmentIntersector, the matrices are 
retrieved from the visitor, yet neither the matrices, nor the points are 
stored. my second guess would be inheriting the LineSegmentIntersector itself 
and modify the descendant to store those translated points.

I found out that having a wall (or any other object) close behind the 
projection pane (e.g. looking into a room from a corner or from a point close 
to the wall) is fine in the osg::viewer, but if i take the camera as the 
starting point of the rays, the rays end up hitting the wall, which is not 
actually seen. that's why i need to start the rays not from the camera, but 
from the projection pane and to do so i need to be able to translate the points 
on it into the WORLD coordinate space.

Thank you for any pointers!

Cheers,
Andrey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46698#46698





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to