PDA

View Full Version : glRotatef



Krime384
09-01-2000, 02: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).]

xvs
09-01-2000, 02: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*/