#### Archived

This topic is now archived and is closed to further replies.

# ratation around an Vector

This topic is 6196 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi.. I have an Identity Matrix. Now I create one Matrix for X-Rotation, one for the Y-Rotation and one for the Z-Rotation. The next thing I do, is to multiply my Identity Matrix with each Rotation-Matrix.. with this method I rotate my Matrix step by step around each achsis.. And here is my problem: I want to rotate around the X-Achsis.. after this I want to rotate around the Y-Achsis, which is changed by the X-Rotation. At Least I want to Rotate around the Z-Achsis, which is also changed by the previous transformations.. I hope somebody understand my problem and is able to help me..

##### Share on other sites
If i got it , you want the rotation matrix around all the three axeses , don''t you ? , well , just multiply the x,y,z rotational matricies one after each other and remember that the order of multypling affects the resulting matrix, that''s to say
you have a resulting matrix that look like taht
R= Mx * My * Mz

##### Share on other sites
Hmmm.. the same thing I did before...

okay.. let's say you have three sticks which are aligned like my three axeses. I clue them together, and put them on my desk. The stick which symbolizes my y-axes points in the sky and the stick which symbolizes my z-axes points in my direction.
Now I take the z-strick an spin it about 90 degrees.
The next thing I want to do is to spin my y-axes.. but what is that. The y-stick changed his position. If I now rotate around the y-stick it's like an z-rotation.. and that's what I want to do..
it's don't cares in what order I perform the transformations the result is the same.

if I transform my Matrix this way:
M = X * Y * Z
the result is different..

Edited by - Kaesebrot on December 26, 2001 7:41:20 AM

##### Share on other sites
I think you''re saying , i have a vector and i want a rotation matrix so i can point on that direction, am i right ?
if so this is a well known problem , solved by quaternions
or through the use of euler angles, but eluler angles , given
some vector direction may cause the well-known gimbal lock, so i usually preferr to stick with quaternions, because the functions
are really long , i suggest you to search in this site for quaternions or email me and request the code from my math library

##### Share on other sites
käsebrot (yeah, i know what this means..)
you have a very nice description of the gimbal-lock. in fact the perfect example why we can''t representate rotations the way you wanted to do. try to read into quaternions, they are really usefull to store orientations and to rotate orientations around (what you wanna do..)

we wanna play, not watch the pictures

##### Share on other sites
okay.. now I know the name of my problem
I will try to read into quaternions..

thx

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013434
×