View Full Version : glRotatef

09-01-2000, 01:38 PM
I am drawing a line using to mouse points with the bresenham algorithim and then rotate that line about the center of it. Is there a way to rotate a screen about a specific point?

[This message has been edited by Krime384 (edited 09-01-2000).]

09-01-2000, 01:46 PM
translate your geometry (the line in your case) by the opposite of the rotation point, then do the rotation. This would translate into:
glTranslatef(-rotpoint.x, -rotpoint.y, -rotpoint.z);
glRotatef(angle, rotaxis.x, rotaxis.y, rotaxis.z);

/* Draw geometry*/