Advertisement

Tutorial 9 confused

Started by August 21, 2002 11:42 PM
-1 comments, last by binsphere 22 years, 6 months ago
Tutorial 9 is confusing me in what it''s doing: especially with the lines: glTranslatef(0.0f, 0.0f, zoom); glRotatef(tilt, 1.0f, 0.0f, 0.0f); glRotatef(star[loop].angle, 0.0f, 1.0f, 0.0f); glTranslatef(star[loop].dist, 0.0f, 0.0f); glRotatef(-star[loop].angle, 0.0f, 1.0f, 0.0f); glRotatef(-tilt, 1.0f, 0.0f, 0.0f); in beginning of DrawGLScene() If I understand, we zoom into the screen 15.0f units (zoom = -15.0 by default). Then we rotate the view so we are looking down, (if we looked inside the monitor, we would now be looking at the bottom of it). Then we rotate the view again, (I don''t see what this does). Then translatef from our current location. Why do we need to rotate, if we just undo it again with the two lines after the 2nd Translatef? Couldn''t we just translatef without that? Any help is appreciated, Im a OpenGL newb, so sorry if this is a stupid question.

This topic is closed to new replies.

Advertisement