Skip to main content
GameDev.net gamedev.net
🔒 Locked

euler angles...

Started by Thrump Nov 15, 2000 at 7:35 AM 6 replies 750+ views
Original Post
Thrump
Thrump
I have an object oriented by 3 euler angles. Now, I have a set of 3 other euler angles, that I want the object to be oriented by. Due to the nature of the problem, I can''t just apply the new 3 euler angles, overwriting everything. I need to apply the original 3, then 3 more to get to the new 3... if you follow me... (the difference between the 2 sets...) What I''m doing now is newEul - oldEul = differenceEul (for each x, y, z rotation) I''m getting really strange results. -0.06, 0.236, 2.562 is what I get... but -0.06, -0.236, 2.562 works... the y rotation is inverted. Lots of other weird stuff is happening. Is the reason this works a fluke, or am I really close to the answer? Is it gimbol lock? Please tell me I don''t have to learn quaternions...
Knarkles
Knarkles
Learn matrices.

-Jussi
Thrump
Thrump
ahhh, thanks?

What aspect of matrices do you think I have to brush up on? Where do you think the problem is? The order of my Matrices? I know the order in which you multiply the x,y,z rotation matrices is important...
Thrump
Thrump
basically, what I want is A*B=C, where A, B and C are rotation matrices. I have the euler angles for A and C. I need the euler angles for B.

I am working with animation though. My problem is this... picture an animation for an aircraft doing a barrel roll. It does this while moving along the x axis (facing along the x-axis as well, unless you got a funky aircraft). Now, picture I have another animation that has the ship travelling along the z-axis. If I want to splice these two animations, I need to rotate the 2nd animation so that it''s along the x-axis, not the z-axis. This case is trivial, but what if the last frame of the 1st animation has an orientation of 30,20,10 (euler angles) and the first frame of the 2nd animation has the orientation 90,0,0 or something. As shown in my first post, using the difference doesn''t seem to work. (or maybe it does and I''m being dumb, I just don''t know the theory behind euler angles very well, so I don''t know what to do... if only one euler angle is different, it works fine, but that''s just the simple 2d case)
shankel
shankel
quote:
Original post by Thrump

basically, what I want is A*B=C, where A, B and C are rotation matrices. I have the euler angles for A and C. I need the euler angles for B.




You can get some good info about converting between Euler angles and matrices (as well as quaternions) at:
http://skal.planet-d.net/demo/matrixfaq.htm#Q36

You have A*B = C,where you know A and C. You want to find B. Multiply both sides of the equation by A^-1:

(A^-1)*A*B = (A^-1)*C or
B = (A^-1)*C

A^-1 = A^T (transpose of A) for rotation matrices.

Then you can convert B back to Euler angles using the formula at in the matrix/quaternion FAQ (URL given above).

Jason
Jason ShankelMaxis/EA
Thrump
Thrump
matrix to euler angles... THANK-YOU

that''s what need

I''ll check it out

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.