PDA

View Full Version : Rotation Origin...



Wei
03-05-2002, 06:02 AM
I use glOrtho(XMin, XMin, YMax, YMax, -10000, -10000) to setup the coordinate system and draw my object based on it, but the problem is that when I try to rotate the object, the rotation point is always on the bottom left, How can I move the rotation point to the center of the object? I know I can manually setup the origin point in the center by doing glOrtho(-(XMax - XMin)/2,(XMax - XMin)/2, -(YMax - YMin)/2, (YMax - YMin)/2, -1000, 1000), and recalculate every vertex based on the new system. But I don't think it is the best solution, Can anyone give me some idea if there is better way to do this? Thanks alot...

Mr_Smith
03-05-2002, 10:04 AM
Easiest way i know is to translate down and left rotate then translate back

Wei
03-05-2002, 12:10 PM
Thanks...Mr_Smith...