Rotating around z-axis

Hi

I wrote a code that let a certain shape to rotate a round z-axis. It works but I was confused Is What I see is really rotating around the z-axis ??!! how to make sure ?

the steps that I followed are as following:

1.set the angle to 0.
2. increase the value of the angle by 0.01 every frame.
3.Rotate the (sphere for example) by
angle = angle,
x = cos(angle)(-0.5)-sing(angle)(-0.5)
y = cos(angle)(-0.5)+sing(angle)(-0.5)
z = 1.
where the intial value for x = -0.5 & y = -0.5 .

Am I right so far ??

Thanks in advance for any help.

Originally posted by glcrazy:
x = cos(angle)(-0.5)-sing(angle)(-0.5)
y = cos(angle)(-0.5)+sing(angle)(-0.5)
z = 1.

With that you rotate the axis around which you turn… well, a bit complex.
If you want to rotate around only z axis, just do :
glRotated(angle,0.0,0.0,1.0);

You will probably see the difference.

Hi ZbuffeR

As I see both methods work in the same way I mean rotate the chosen object around z-axis …

Thank you