Archived

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

happyman

prob with glvertex3f()

Recommended Posts

here is my question.i created a window with 300x300 resolution.i tried to draw a 2d triangle but the screen stayed blank .i changed the coordinates to (.2,.4) (.1,.3) (.2,.5) (between 0 and 1) and then it appeared.it seems the center of the screen is 0,0 and a point glvertex3f(2,2,0) seems to go out of the screen.why is this so?.what coordinates system does glvertex use.if 0,0 is center,shouldnt 150,150 be the edge.i tried it in perspective mode and it is the same.why does only 0-1 appear on the screen and everything else get clipped.

Share this post


Link to post
Share on other sites
You do know that the default camera look at direction is negative, right? So if you want to see your triangle, change the camera look at direction with gluLookAt() or, change the depth of your of your vertices to negative value.

Share this post


Link to post
Share on other sites
i changed the value to -ive and its ok.but still why does only world coordinates in the range of 0 to 1 appear on the screen.
really weird

Share this post


Link to post
Share on other sites
Try this and be astounded (I hope):
glTranslatef (0.0f, 0.0f, -10.0f);
OpenGL doesn't actually use pixel coordinates

[EDIT] to be more specific...place that line in your draw routine just after you clear the buffers

[edited by - Thunder_Hawk on November 8, 2002 10:15:04 PM]

Share this post


Link to post
Share on other sites