Translate the field away from the viewer. Rotate the field. For Each Star: glPushMatrix Translate to The Star''s Position Rotate the star so that it''s facing the viwer Draw It. glPopMatrixThe trouble is that the transformations in the loop slow everything down. I''m using three glRotatef calls for each iteration (and a glTranslatef), and it seems to me that there must be a way of converting three rotations around the canonical axes into one rotation around a different axis. If I don''t do the transformations, the stars don''t face towards the viewer: when the starfield is rotated 90 degrees you''re looking at the quads side on and the effect is not pleasing, to say the least. So I have to do the transformations in some form. I''ve tried without the matrix stack operations - just reversing the rotations and translations at the end of each iteration.
Translate to The Star''s Position Rotate around x, y, z Draw It. Unrotate around z, y, z UntranslateIt''s a little bit slower. If the six rotations can be condensed into two operations, that''d probably be better. It just occured to me that using the second method I could precalculate the translation from one star to the next, and thusly avoid the untranslate.
One solution I tried was creating a display list of the star field. The list was made just fine, but when I play it back, it ignores any rotations I''ve applied to the modelview matrix. Is that how display lists are meant to operate, or must I be doing something wrong? Just Plain Wrong