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

pixel mesurement

Started by samosa Aug 14, 2002 at 1:16 PM 1 replies 500+ views
Original Post
samosa
samosa
a while ago i bought a 2d book on directX, i found all of the initialization very confusing and it seemed like i had no control over what my program did, so following a friends advice i went to opengl, i am now programming a 2d breakout clone with opengl, ive gone back to that book as a source for 2d programming theory and implementaion, anyway, in that book they measure where sprites are and movement in pixels, opengl uses floats( 1.0f etc) which is a faily large unit(in 2d) does anyone know how i can set where a player is on the screen using pixels? like (320, 271) would be approx in the middle of a 2d 640X480 screen, any help would be appreciated, and if its all pointless and better to use opengl''s floats, plz just let me know, thanks ,Matt -= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
jwalker
jwalker
well, why not ?.
you can use absolute positions in with ortho projection.
maybe i dont understand your question, but you can specify 300,200 on the screen if you want to .

Its my duty, to please that booty ! - John Shaft
zedzeek
zedzeek
use something like gluOrtho2d(0,640,0,480) now 320,240 is the middle of the screen
(check the faq for the correct way)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Topic Locked

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

Sign in to reply to this topic.