#### Archived

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

# Rotating Point a Point a 3 Axes

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

## Recommended Posts

I have read so much about Matrixes ... but i dont know how to use them on an Normal Vertex! ( so Rotate it around 3 Axis ) thx

##### Share on other sites
A vertex is a vector. A specific type of vector. It is a position vector. You rotate a vertex by multiplying a matrix by a column vector or a row vector by a matrix. You don''t use the same matrix for both, but rather one is the a transpose of the other. I believe there are tutorials under Articles & Resources on how to multiply two matrices or a matrix by a row or column vector. There are also tutorials on how to construct various matrices for various purposes. The devrivation of things like projection and axis angle matrices is quite complex.

A rotation matrix for rotating around the primary axes is quite simple. It is the addition and subtraction formulas from trig, i.e. sin(a+b) and cos(a+b). A is the angle of the current point and b is the amount you are rotating by. In 2D the current position is x=r*cos(a) and y=r*sin(a) where r is the distance from the origin. After rotation it is x''=r*cos(a+b) and y''=r*sin(a+b). The addition formulas give you sin(a+b)=sin(a)*cos(b)+cos(a)*sin(b) and cos(a+b)=cos(a)*cos(b)-sin(a)*sin(b). So x''=r*cos(a+b)=r*cos(a)*cos(b)-r*sin(a)*sin(b), but x=r*cos(a) and y=r*sin(a) so x''=x*cos(b)-y*sin(b) and similarly for y''. If you look at how you multiply a matrix by a vector then it becomes obvious why you build a rotation matrix as you do. The reason you multiply two matrices as you do is because that is what is useful. One of the many benefits is that when you multiply two rotation matrices together you get something useful instead of garbage as you would if it was defined differantly.

• 9
• 48
• 12
• 10
• 10
• ### Forum Statistics

• Total Topics
631381
• Total Posts
2999676
×