Archived

This topic is now archived and is closed to further replies.

WoolyUK

Stupidly simple problem :)

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites