PDA

View Full Version : Rotation question

robERTk
07-10-2002, 07:23 AM
First here is code:

glPushMatrix
glRotatef 90, 1, 0, 0
glRotatef 30, 0, 0, 1
glRotatef 90, 0, 1, 0 //Point cylinder to the right
drawCylinder //draws cylinder at (0,0,0) and endpoint (0,0,3)
glPopMatrix

The question is: I don't understand why x-axis rotation turns cylinder toward me (clockwise rotation) instead of rotating counterclock-wise??

Batsu
07-10-2002, 07:54 AM
what do you mean by turn to face you?, that the top of the cylinder is facing you?, if thats the case, then its alright, cause the glRotatef is always counter-clockwise, so along the x-axis it will be showing you the top of the cylinder on the positive z-axis and the bottom on the negative z-axis.

coredump
07-10-2002, 08:56 AM
I don't understand why x-axis rotation turns cylinder toward me (clockwise rotation) instead of rotating counterclock-wise??
right hand rule: point the thumb of your right hand in the positive direction of an axis and your fingers will curl in the direction of a positive rotation.

robERTk
07-10-2002, 11:12 AM
Originally posted by coredump:

I don't understand why x-axis rotation turns cylinder toward me (clockwise rotation) instead of rotating counterclock-wise??
right hand rule: point the thumb of your right hand in the positive direction of an axis and your fingers will curl in the direction of a positive rotation.

I obviously have been rotating too much. Thanks.