nk
05-15-2004, 01:27 AM
I have a window and I want to draw a line for each side of the window in OGL.
I do this by setting the projection and modelview matrix to the identity matrix
(glMatrixMode(GL_PROJECTION);glLoadIdentity();..)
then I call
glVertex3d(-1,-1,0);
glVertex3d(-1, 1,0);
for left side of the window for example.
The code works fine, the line appears on the left side of the window(line width is 3).
My problem is: on what principle OGL convert this 3D vertices in 2D points on my window. How came that the vertices are not clipped(any value greater the 1 for the coords of the line is clipped).
I know that by setting to the identity matrix, the vertices remain the same, but what happens next -> 3D to 2D, clipping?
Thanks.
I do this by setting the projection and modelview matrix to the identity matrix
(glMatrixMode(GL_PROJECTION);glLoadIdentity();..)
then I call
glVertex3d(-1,-1,0);
glVertex3d(-1, 1,0);
for left side of the window for example.
The code works fine, the line appears on the left side of the window(line width is 3).
My problem is: on what principle OGL convert this 3D vertices in 2D points on my window. How came that the vertices are not clipped(any value greater the 1 for the coords of the line is clipped).
I know that by setting to the identity matrix, the vertices remain the same, but what happens next -> 3D to 2D, clipping?
Thanks.