Daniel Zuidinga wrote:
> can“t anybody help me?
>
> is there a chance at all to get the right transformation data? or have i 
> to save the data elsewhere?
>   
Your rotx/y/z are known as "euler angles". OpenSG stores a matrix, whose 
rotation-part can be extrated as a quaternion. Feel free to read up on 
euler angles vs. matrices vs. quaternions. You will need some 
understanding of these terms to grasp and solve your problem (and 
perhaps to make sense of some points below). Google for it.

The components of a quaternion is not at all like the euler angles you 
created it from (for one thing, there's four values, not three). It's a 
quite different beast with advantages (no singularities with 90 deg 
rotations, known as "gimbal lock") and disadvantages (almost impossible 
to deduce the rotation effect from looking at it's values).

However, the qX quaternion you use to accumulate euler-toations and use 
as rotation component in the matrix (in setObjectTranslation) should be 
pretty equivalent to the rotation you retrieve in the get-function. Now, 
decomposing a rotation into euler angles is possible, although since 
some rotations can be caused by several combinations of euler angles, 
you might not get back exactly what you put in, but at least something 
equivalent. Code for this is _not_ in OpenSG, but there should be some 
on the net, that you might be successful with.

However, for simplicity, I suggest you avoid trying to read-back your 
euler angles, and use them as little as possible in any form of 
animation. Try to learn and use matrices instead. Use quaternions only 
to create the rotation you want, as you have done, then put them in a 
matrix.

Rotation in 3D is a inherently difficult problem (mathematically), but 
most of us manage with just avoiding common pitfalls, so don't feel 
intimidated by it all.

Hope it helps,
/Marcus




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to