Advertisement

glVertex2f - problem

Started by June 10, 2002 04:25 PM
1 comment, last by Austrian Coder 22 years, 8 months ago
Hi. I have a littel problem. Why does this work glRasterPos2f(400.0f, 400,0f) ans this glVertex2f(400.0f, 400,0f) not? (Window: 800x600); Ok this is maybe a bad question. Is there a way to convert it? Or must i try it over 20 times, until i found the correct paramters? thx, Austrina Coder
Did you set up an orthographic projection?

gluOrtho2D (0,799, 599, 0);
Advertisement
if you''re not in orthographic mode, you''re
drawing your vertices appx 400 screen sizes
outside your current scene

if you actually WANT to use perspective projection
and you want something thats "400x400" on the screen,
that''d actually be glVertex2f(1/400, 1/400);
think of your screen as 1 unit...
leftmost is 0, rightmost is 1.. everything in between
is a decimal.

in orthographic projection you dont have to worry about any
of this though. you just have to stay within the coordinates
you initialize with gluOrtho (see above post).

i suggest you check out nehe.gamedev.net tutorial 21

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

-eldee;another space monkey;[ Forced Evolution Studios ]

This topic is closed to new replies.

Advertisement