Re: [osg-users] getting eye position / direction

2012-04-15 Thread Andrey Ibe
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;

Re: [osg-users] getting eye position / direction

2012-03-31 Thread Andrey Ibe
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); //

Re: [osg-users] getting eye position / direction

2012-03-30 Thread Andrey Ibe
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

Re: [osg-users] getting eye position / direction

2012-03-18 Thread Andrey Ibe
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

[osg-users] getting eye position / direction

2012-03-09 Thread Andrey Ibe
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();

Re: [osg-users] getting eye position / direction

2012-03-09 Thread Robert Osfield
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

Re: [osg-users] getting eye position / direction

2012-03-09 Thread Andrey Ibe
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

Re: [osg-users] getting eye position / direction

2012-03-09 Thread Robert Osfield
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