Skip to main content
GameDev.net gamedev.net
🔒 Locked

glVertex2f - problem

Started by Austrian Coder Jun 10, 2002 at 4:25 PM 1 replies 550+ views
Original Post
Austrian Coder
Austrian Coder
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
invective
invective
Did you set up an orthographic projection?

gluOrtho2D (0,799, 599, 0);
eldee
eldee
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::

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.