Translation relative to rotation

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?

You are calling first glTranslate and then glRotate, aren’t you? Solution: Simply swap the order of the calls.