2

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 ?

Al_th
  • 1,174
  • 1
  • 12
  • 24
  • That all looks correct. The fault is somewhere else. – Marius Jun 25 '13 at 20:34
  • Well I just figured out what the problem was (It was related to a moving function wich was putting me way off rendered scene)... Thanks for reassuring me on the understanding of glutlookat anyway, I stopped looking to that direction ! – Al_th Jun 25 '13 at 21:15

1 Answers1

3

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.

Benlitz
  • 1,952
  • 1
  • 17
  • 30
  • You are indeed right ... Was a little bit tired yesterday and it ended up working, but with some tweeking, and the tweek was actually involving Y / Z axis. I modified back to my previous version this morning with your answer included and it worked right away. I am still struggling with the XYZ usage in games with Y being commonly the "up" vector. – Al_th Jun 26 '13 at 07:24