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;
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);
//
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
again, thank you, robert. now i know i'm getting correct results.
regards,
Andrey
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46391#46391
___
osg-users mailing list
Hi,
i am trying to get eyePosition and direction, more precisely, the direction of
a ray for the purpose of ray tracing.
this is what i am doing:
Code:
const osg::Vec3d collisionPoint = intersection.getWorldIntersectPoint();
...
osg::Vec3d eyeDirection = collisionPoint - _tracer-getEye();
HI Andrey,
I'm rather confused about what you are trying to do, you question
seems rather mixed up. Could you take a step back and explain at a
higher level what you are trying to achieve and we can then point you
in the right direction of how to achieve.
Robert.
On 9 March 2012 08:29, Andrey
i am trying to compute the direction of an osg::LineSegmentIntersector object.
i can get the collision point and i am trying to get the starting point - i
need the vector of the intersector's direction.
i do this for the purpose of ray tracing (or ray casting). i create the
intersectors this
Hi Andrey,
Thanks for the explanation, make more sense now.
If you have a perspective camera then you'll be able to assume that
the all the line segments will start at the cameras eye point and end
at the intersection point that is returned. To compute the camera's
eye position in world
8 matches
Mail list logo