Vector Rotations

By: W-Buffer

Yeah, this is a rotations tutorial, with this tutorial you'll learn how to rotate a vector on all his axis.

To start you gotta learn some theory about rotations:

To rotate a vector you need to pick an axis that won't move, over this axis will be the rotations, and the Radians of the rotation, OK, let's suppose that you picked Z axis, now 'X, 'Y and 'Z are the new vector after the rotation and Rads are the Radians of the Rotation, here how to rotate it:

'X = X * Cos(Rads) + Y * Sin(Rads)
'Y = Y * Cos(Rads) - X * Sin(Rads)
'Z = Z

To rotate an Axis you multiply the old axis value by the Cosine of Radians plus the other Axis and multiply by the Sine of Radians, the other axis is the same but you don't add (+) the other axis, rest it (-). The Picked axis won't move and you won't use it in the others axis calculations, here is a function to do the same but in VB:

* if you are asking, now what?
R.- Now goto Downloads on the Tutorials Section to dowload a .Bas that i maded to Rotate Vectors, Vertexs and Variables. Feel Free to use it in your project, if you wanna post it somewhere else that here just contact me.

Hosted by www.Geocities.ws

1