Stupidly simple problem :)

Started by
5 comments, last by WoolyUK 20 years, 8 months ago
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!
Advertisement
aye, if u have backface culling on, it will not show, try reordering the vertices so they are clockwise
-"watch out for the flying bullets!"-"Its not the birds but the bees that I'm worried about"
nope still dont work thanks for suggestion
the camera is probably facing the wrong way...
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
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.
_______________________________________Pixelante Game Studios - Fowl Language
Simple problem.

Just change the gluLookAt to
gluLookAt(4.5, 10, 7.5, 4.5, 0, 7.5, 0, 0,-1);

This topic is closed to new replies.

Advertisement