문제

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 ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top