Hi,
don't try to make the rotation matrix manually, try using the
makeRotate() function of the Matrixd class. It can take a vector to
rotate about and an angle.
Also, OSG has only one version (pre/post mult) of quat * vec and not the
other. The conventions are also mixed up compared to matrices.
see here:
http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/43425
So I'd suggest doing the multiplication and rotation using only
matrices. It's OK to init a matrix from a quat. Make a simple test case
for yourself to understand the order of operations (e.g. m1*m2*v versus
v*m2*m1).
cheers
jp
On 20/08/10 10:28, Frankie Avalon wrote:
Hi,
I have the following situations. I get rotations in form of quaternions from a
system, with a pre-defined coordinate system. These rotations are used to
transform the view matrix later on.
However, the difference of coordinate systems, conversion from quaternion to
euler, matrix, etc. and the multiplication orders are giving me a headache.
Bsaically what I have now is something like:
Code:
osg::Quat _orientation = (
osg::Matrix::rotate(_rawQuat) *
osg::Matrix( 0.0, 0.0, -1.0, 0.0,
1.0, 0.0, 0.0, 0.0,
0.0, -1.0, 0.0, 0.0,
0.0, 0.0, 0.0, 1.0)
).getRotate();
Here the second matrix basically should transform from local space to my world
space. X axis represents yaw, Y pitch and Z roll.
The orientation is pretty much correct... except the pitch is negated.
(Up is down and down is up).
So I figured, no problem. It's just a missing sign!
... if only reality was that simple.
All my attempts to modify that second rotation matrix have failed.
I end up creating Euler singularities or always exchange the wrong axes.
This kind of made me lose my mind and perspective, because I think I no longer
really understand what I'm doing.
Can somebody help me understand this?
Thank you!
Cheers,
Frank[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30954#30954
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org