question about the coordinate

Started by
0 comments, last by Limitz 17 years, 9 months ago
in this code glLoadIdentity(); glTranslatef(-1.5f,0.0f,-6.0f); glBegin(GL_TRIANGLES); glVertex3f( 0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f); glEnd(); i have some question about the coordinate in OpenGL: 1 glTranslatef(-1.5f,0.0f,-6.0f); what dose this mean? is that move a world coordinate, a view coordinate,or a view point? 2 about the triangles,is that points (0,1,0),(-1,-1,0),(1,-1,0) all in the world coordinate?
Advertisement
hi,

it translates the matrix that is currently in use, you set it by setting the MatrixMode. If this is MODELVIEW it translates the modelview matrix (which is probably what you want.

LoadIdentity makes the currentMatrix the identity matrix

100
010
001

translate adds the values to this matrix

and it becomes

-0.5 0 0
0 1 0
0 0 -5

If the current Matrix Mode is MODELVIEW it uses this matrix to translate the coordinates of the triangle you draw next

Greetings...

This topic is closed to new replies.

Advertisement