[ODE] XYZ Axis Orientation and 0 degrees

Paul Carrington paul at vulcan.co.uk
Sun Sep 26 04:24:34 MST 2004


Hi Jon Watte,

Thanks for your response and sorry it has taken so long for me to reply

>There is no "up". There is no "identity orientation" per se.

>From your explanation i now see that it doesn't matter what the x,y and z axis's are
used for and how "up" can be any axis (clever stuff indeed) :)

That aside, I am still having problems with euler angles

I realise that i need to convert "my" euler angles (plucked from an object within my
own graphics engine) into something that ODE understands and later convert an
euler angle (plucked from an ODE matrix) back into something my engine
understands

All of this 'in theory' should be easy, with no conversions required, but i have
noticed that the way "my" engine creates matrices and derives euler angles is
slightly different to ODE

For example, the function in ODE called "dRFromEulerAngles" creates a matrix
from the passed X Y Z angles and constructs the matrix like so

                [0]     [1]                     [2]         
[0]     (Yc*Zc) ((Xs*Ys)*Zc)-(Xc*Zs)    ((Xc*Ys)*Zc)+(Xs*Zs)  
[1]     (Yc*Zs) ((Xs*Ys)*Zs)+(Xc*Zc)    ((Xc*Ys)*Zs)-(Xs*Zc)   
[2]      -Ys    (Xs*Yc)                 (Xc*Yc) 

with these being these

 Xs = sin(X)
 Xc = cos(X)
 Ys = sin(Y)
 Yc = cos(Y)
 Zs = sin(Z)
 Zc = cos(Z)

now my graphics engine uses this method

        [0]             [1]                     [2]          
[0]     (Yc* Zc)        ((-Xs*-Ys)*Zc)+(Xc*Zs)  ((Xc*-Ys)*Zc) +(Xs*Zs) 
[1]     (Yc*-Zs)        ((-Xs*-Ys)*-Zs)+(Xc*Zc) ((Xc*-Ys)*-Zs)+(Xs*Zc)  
[2]     Ys              (-Xs*Yc)                (Xc*Yc)   

the most noticeable difference being the negative sin values...

Now i'm pretty sure i can "eventually" create an "interpreter function" that can
convert "my" euler angles into something ODE likes and later convert back from a
manipulated ODE matrix into something my engine likes

But to make this process easier, i first need to understand how ODE treats the 0
and 90 degrees on all 3 axis's

So my question would be.......

Within ODE, is the following true and if not (as i suspect) then what is?

        0 degrees around X axis points along the positive Y axis
        90 degrees around the X axis points along the positive Z axis

        0 degrees around the Y axis points along the positive Z axis
        90 degrees around the Y axis points along the positive X axis

        0 degrees around the Z axis points along the positive Y axis
        90 degrees around the Z axis points along the negative X axis

here is a jpg of "my" engine axis orientations in case it's easier to visualize

http://www.vulcan.co.uk/artwork/xyz.jpg

Paul Carrington
Vulcan Software Ltd.
http://www.vulcan.co.uk



More information about the ODE mailing list