prob with glvertex3f()

Started by
3 comments, last by happyman 21 years, 5 months ago
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.
cubesss
Advertisement
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.
I don't have a signature
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
cubesss
when i said 0 - 1 i meant only the x and y coordiantes.
cubesss
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]
______________________________________________________________________________________The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ"So. Any n00bs need some pointers? I have a std::vector<n00b*> right here..." - ZahlmanMySite | Forum FAQ | File Formats______________________________________________________________________________________

This topic is closed to new replies.

Advertisement