PDA

View Full Version : Help me understand viewing transformations



marce
08-08-2009, 05:53 PM
I have now almost read the Red book but I still find the logic of the viewing transformations very hard.

Have a look at this image: http://img17.imageshack.us/img17/5290/opengll.png

I would like to make some quads, each of them in the same size, but in different Z and X positions.

What is the correct way to make this?

Like

glTranslate*();
glBegin(GL.GL_QUADS);
first quad
second quad
third quad
...
glEnd();
or

glTranslate*();
glBegin(GL.GL_QUADS);
first quad
glEnd();

glTranslate*();
glBegin(GL.GL_QUADS);
secondquad
glEnd();

glTranslate*();
glBegin(GL.GL_QUADS);
third quad
glEnd();

zeoverlord
08-08-2009, 07:13 PM
the second one looks like a winner, just make sure you get the right order and numbers, or just give it a whirl and see what happens.

though the probably easiest and most correct way is to add a pop matrix and push matrix around each set