you need to create a rotation matrix. and multiply the vector through the rotation matrix. if you want to know how OpenGL does it....
go here.... OpenGL Programmer''s Guide click on the Appendix F Homogeneous Coordinates and Transformation Matrices chapter and go down to glRotate .....
if you need to know how to multiply a vector through a matrix, search the web or gamedev....
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
In this example matrix, the letter a stands for the angle of rotation, in radians. Angles are measured clockwise when looking along the rotation axis toward the origin.
quote:Original post by jenova you need to create a rotation matrix. and multiply the vector through the rotation matrix. if you want to know how OpenGL does it....
Couldn''t the techniques I used in the small program (I sent to this thread) be useful as well?
If you are applying a lot of transformations to your scene using OpenGL functions, it may be easier to get the exact result this way.
you can do it that way.... i was only providing a link to allow the original poster to understand the math behind glRotate .... most OpenGL (x86) implemetations will either use specialized vector units or SSE (if available) to speed things up.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.