Screen Coordinates
Hello there, i have not used OpenGL in a long time =( and i am making a pong game that can be ran in differant resolutions or windowed, i have 2 coordinates that tell me where the ball is... i am going to use the edge of the window as the boundaries for the game but what i want to know is how can i tell if my ball is about to leave the boundaries of the window no matter what resolution its being played at... im sure i could do the trial and error way of guessing and fixing... but there has to be an easier/better way of doing this...
thank you
[edited by - dirtypope on April 21, 2003 11:26:22 PM]
Theres no such thing as stupid people... only people with under clocked brains. -dirty
I could be wrong, but if you use an orthographic projection (which I believe would work fine for a pong game) and the glVertex2i function then you''re working directly with screen coordinates. In other words, if you were running at 640x480 and drew a point like so: "glVertex2i(639, 479)" you would be drawing a point just at the corner of the screen. This should make your desired collision detection at the edge of the screen very easy. Someone can correct me if I''m wrong.
--- Alex Broadwin
--- Domini Nocti Games
--- Alex Broadwin
--- Domini Nocti Games
- [email=atronic@gamebox.net]Alex Broadwin[/email]- Adroit Creations- My Journal- The All-Knowing One
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement