Skip to main content
gamedev.net
🔒 Locked

Set up the projection for 2D drawing?

Started by derek_of_bodom@hotmail.com Feb 24, 2012 at 3:26 AM 1 replies 1.3k views
Original Post
derek_of_bodom@hotmail.com
derek_of_bodom@hotmail.com
I'm trying to figure out how to set up the projection for 2D drawing. I know to use glOrtho, but I'm wondering how I can set up the projection so that (-100.0,-100.0) is the top-left corner of the screen, and (100.0,100.0) is the bottom-right corner of the screen. Can anyone point me in the right direction?
karwosts
karwosts
Did you look at the documentation for glOrtho? Should be pretty self explanatory.

glOrtho(-100, 100, 100, -100, near, far) should be what you want.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
derek_of_bodom@hotmail.com
derek_of_bodom@hotmail.com
That doesn't seem to be working though. I don't know if I'm drawing incorrectly or what, but my rectangle is definitely not showing up where it's supposed to. In fact, it's not showing up at all.

Edit: Figured it out. Turned out I had back-face culling on. No idea why.

Topic Locked

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

Sign in to reply to this topic.