PDA

View Full Version : rotation



09-22-2002, 05:27 PM
how would i make a line, anywhere in the first quadrant rotate about the origin?

ChuckB
09-22-2002, 07:29 PM
Hi,
The rotate below will rotate the line about the +Z axis which points out of the screen.

angle += 0.1;

glRotatef(angle,0,0,1);
glBegin(GL_LINES);
glVertex3f(0,0,0);
glVertex3f(10,0,0);
glEnd();
. . .

The line above lies along X axis at 0 degrees.

That should work for you.

Regards,
ChuckB