Hello,

On 07/26/2014 07:35 PM, Gerlina Steffen wrote:
> For my project I have the following things:
> - A OSG::Quaternion which represents an input device (something similar
> to a Razer hydra)
> - A OSG::Line to calculate intersections
> With the device I want to point onto things (something like a laser
> pointer) in my scene. Unfortunately, to calculate intersections OpenSG
> uses the OSG::Line class, so I need to translate my Quaternion into a
> Line. The position is no problem, but with the calculation from a
> rotation as a Quaternion to a direction as Vec3f I have problems.
> To get my direction vector I use "device.getEulerAngleRad(ray_direction)".

I don't think that is the function you want, it decomposes the rotation 
represented by the quaternion into euler angles and stores these angles 
(in radians) in the vector.
You probably want something like Quaternion::multVec(src, dst), which 
applies the rotation to the vector src and stores the transformed result 
in dst.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to