# rotations

Hello…
I have found a formula to rotate a vector about an arbitrary axis at
http://www.cise.ufl.edu/~cmccann/seniorp…or%20rotation’
… I wish to find the counterclockwise rotation around the arbitrary vector (u, 0, w); I’m setting v to 0 since my arbitrary vector involves rotations not including the y-axis.
Since I don’t have the matrix to invert it and only the final vector formula, I thought I could rotate the vector (u, 0, w) by 180 degrees around the y axis getting (-u, 0, -w). Plugging those values in didn’t hold…
Am I doing something wrong or is there another way to do it?

Thank you,
-TS…

Thundersoul,
These formulas help you to understand the meaning of the OpenGL architecture. Do you want to use from the OpenGL to write your programs?
As i said before, to rotate around a vectore (vx, vy, vz ) you can use from the following function:
glRotatef( angle, vx, vy, vz );

In OpenGL, we use from the homogeneous coordinate system. It means that we can use from both the points and vectors in our application. the fourth component(w) specifies the type of your primitive–Vector or point.to rotate a point around a vector set its w component to 1.to rotate a vector around a vector set its w component to 0.

As an example, here’s a code that rotates the point p(x,y,z,1) around a vector( vx, vy, vz )

GLfloat p[] = { x,y,z, 1};

glRotatef( angle, vx,vy, vz );
glVertex4fv§;

And here’s a code that rotates the vector p(x,y,z,0) around a vector( vx, vy, vz )

GLfloat p[] = { x,y,z, 0};

glRotatef( angle, vx,vy, vz );
glVertex4fv§;

-Ehsan-

Maybe it helps what I wrote in the Math forum.

By the way please do not cross post.