Hi, this post is for those reading this thread wondering how i solved the issue.
I solved it by creating the line segment intersectors in model coordinate
space, transforming the starting/ending point using this matrix:
Code:
osg::Matrixd matrix;
matrix.preMult(_masterCamera->getViewport()->computeWindowMatrix());
matrix.preMult(_masterCamera->getProjectionMatrix());
matrix.preMult(_masterCamera->getViewMatrix());
_renderMatrixInverse->invert(matrix);
This way the lineSegmentIntersector gets initialized correctly and the
intersections are computed well. The problem itself originated elsewhere - i
was using the camera as the ROOT node for intersectionVisitor, which did not
behave the way expected.
I encountered another issue when using the camera as the root - the invisible
parts of the scene got culled away (as expected for rendering), however, while
computing reflected rays, this caused serious issues, as these rays did not hit
the expected objects, because they 'were not there'. I had to use own matrix
transformation for the primary rays and let all the rest compute in the model
coordinate space, the scene being the root (without any other transformations).
take care,
Andrey
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47056#47056
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org