Question

Lets say I do have the following set up :

glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(0,0); glVertex3f(-10, 0, 0);
glTexCoord2f(1,0);  glVertex3f(10, 0, 0);
glTexCoord2f(0,1); glVertex3f(-10, 0, 5);
glTexCoord2f(1,1); glVertex3f(10, 0, 5);
glEnd();

And I do the following

gluLookAt(0,0,10, 0,5,0, 0,1,0);

I should end up with a "virtual world" like the one below, right ?

enter image description here

For a strange reason, nothing appears on screen and I can't figure out why. Any idea ?

Was it helpful?

Solution

It seems like you inverted Y axis and Z axis in your triangles. You probably wanted to write this:

glTexCoord2f(0,0); glVertex3f(-10, 0, 0);
glTexCoord2f(1,0);  glVertex3f(10, 0, 0);
glTexCoord2f(0,1); glVertex3f(-10, 5, 0);
glTexCoord2f(1,1); glVertex3f(10, 5, 0);

This corresponds better to the figure you attached to your question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top