Hello,

Thank you for your response.

Two things:

a) I am not sure to understand why my matrix should be an identity. You were right it wasn’t. I translated the modelview matrix 20 unity forward.

I computed the height and width when the translation was done. Shouldn’t it work?

I mean the volume doesn’t change if I am 20 unit forward in the volume, right? I assumed when the drawing is over that I look from the identity matrix.

Maybe I am using the modelview matrix incorrectly. I thought that once the volume is built thanks to the projection matrix, I could position my object inside it and always view them.

The idea behind my example was to draw a rectangle of a fixed size, let say 5 x 10 and position it at a certain depth at the top left corner. Depending on the depth level I could then add others rectangles so I could fill the screen, but always using the initial value of the rectangle 5 x 10.

i.e. at a translation of n units forward z I could draw 10 rectangles on the same row and at a translation of 2n units forward z I could draw 20 rectangles on the same row.

b) I am using a book (OpenGL SuperBible), and it is using glRect (in the first chapters for now), what is the new alternative?