Advertisement

opengl question screen coordinates

Started by December 11, 2002 10:06 PM
2 comments, last by geistATL 21 years, 11 months ago
i just started using opengl and im trying to make a ball bounce around the edges of the screen in the x y plane. however i cant figure out how im suppose to knwo what the coordinates of the edges of the screen are. i did figure them out by trial and error but how are you supposed to know? can someone explain. thanks
Use an orthographic projection matrix set to the size of the screen in pixels (see glOrtho).

Advertisement
so wihtout doing this. there is no way to know what the screen coordinates are?
you can multiply your coordinates by the modelview matrix, project them into screenspace, and finally offset them relative to the viewport.

This topic is closed to new replies.

Advertisement