PDA

View Full Version : Translation relative to rotation



Mordicaii
01-12-2010, 01:56 PM
Is there any way to translate a square (or what have you) from one point to another while ignoring the shape's rotation?

I've been trying to write a small program to draw a square that rotates on the x-axis, while simultaneously moving away from the user, however when I run the program, it translates relative to the rotation of the shape, basically making a large loop.

How do I fix this?

Yomboprime
01-12-2010, 03:21 PM
You are calling first glTranslate and then glRotate, aren't you? Solution: Simply swap the order of the calls.