What is the difference between
glRotatef(angle, 1.0f, 0.0f, 0.0f);
glRotatef(angle, 0.0f, 0.0f, 1.0f);
and
glRotatef(angle, 1.0f, 0.0f, 1.0f);
And why nothing change when I change the second paramater 1.0f to 5.0f? Lastly, how can I rotate an object around x=5 and not around x=0?
If you want to rotate around
x=5
you should do aglTranslate
tox=5
and whatever your y coordinate is and then doglRotate
thenglTranslate
back to the origin.So something like
For the first question I'm including @genpfault's answer for completeness. It is due to vector normalization done by
glRotatef()
on the vector you pass in.