Stupidly simple problem :)
Hi guys - im almost embarassed to ask this, cus ive done quite a lot of OpenGL but for some reason this has got me really stumped
Im trying to draw a simple quad and set the camera to look directly down on it, im using the following code and it just brings up a blank screen:
gluLookAt(4.5, 10, 7.5, 4.5, 0, 7.5, 0, 1,0);
glColor3f(1,0,0);
glBegin(GL_QUADS);
glVertex3f(0,0,0);
glVertex3f(9,0,0);
glVertex3f(9,0,15);
glVertex3f(0,0,15);
glEnd();
Im using the nehe base code and any other drawing stuff works (ie nehe examples).
What stupid mistake am I making?
Thanks for any help!
aye, if u have backface culling on, it will not show, try reordering the vertices so they are clockwise
How do u mean facing the wrong way? The cam postion is 10 units up the Y axis looking down, so shouldnt it automatically point downwards?
Thanks for reply
Thanks for reply
The camera is facing directly against the Up vector which might be what''s causing problems (doesn''t work when I try it in my program).
Try:
gluLookAt(4.6, 10, 7.5, 4.5, 0, 7.5, 0, 1,0);
and see if it shows up. If it does and you need to look straight at the quad then reposition the quad so it goes along the x/y plane and not the x/z plane.
Try:
gluLookAt(4.6, 10, 7.5, 4.5, 0, 7.5, 0, 1,0);
and see if it shows up. If it does and you need to look straight at the quad then reposition the quad so it goes along the x/y plane and not the x/z plane.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement