Hello I am trying to understand matrix operations behind OpenGL and I have some questions.
1- When we first create a simple window using glut and opengl, we use such a command below to draw a simple triangle.
glBegin(GL_TRIANGLE);
glVertex3f(0.25, 0.25, 0.0); // coordinate 1
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0); // coordinate 3
glEnd();
Does this drawing take plece in object coordinate sytem or at other coordinate sytems ?
Assume that, I applied a transformation using glTranslate(), so this translation manipulates the modelview matrix. Now if I apply the command above again
glBegin(GL_TRIANGLE);
glVertex3f(0.25, 0.25, 0.0); // coordinate 1
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0); // coordinate 3
glEnd();
Is this drawing still done in object space coordinates and transformed to eye space using modelview matrix ?
edit:
at first when you use command glvertex(0,0,0) , you draw a point at (0,0,0) in both object, world and eye coordinates it is (0,0,0). of course this is done after modelview matrix is cleared using gloadidentity().
now apply the command gltranslate(2,0,0) , and again use command glvertex(1,0,0), now you draw a point at (3,0,0) . this is good but which coordinate system (3,0,0) is represented in ? do you draw in eye coordinates (3,0,0) ?
Is my thought below true ?
I think that glvertex(1,0,0) draws a point in object coordinate (1,0,0) , and since model view 4x4 matrix now is not an identity but has a "2" at the first row and fourt column because we applied gltranslate(). if we multiply our new modelview matrix with (1,0,0) in obj. coordinates, now we have (3,0,0) in eye coordinates .