Now, I want to represent shift of the origin point ((0,0,0,1)) of the above two transformations by one glTranslatef first in order to track the object position, and put glRotatef after that:
As someone said, you must use radians. Also, the way GL multiplies matricies, you should put the order of translation/rotation backwards; i e start at where you draw, and put each operation above the drawing, going upwards.
This will result in the thing being first rotated about its internal Y axis, and then positioned where you wish it. If you think about it, it makes sense, because you start
by rotating the viewer and translating the world. You can use glPushMatrix() to great effect if you do recursive structures:
Of course, once you start performance tuning, you may wish to keep an aggregate translation matrix and just glLoadIdentity() and apply the (single) matrix for each item, instead. But save that for the optimization phase; no use confusing the issue while you’re still getting your rendering up.
PS: dontcha hateit when some perfectly innocent code turns into smiley faces just because the method name happens to start with a “D”?
[This message has been edited by bgl (edited 07-02-2000).]