Jump to content

View more

Image of the Day

I've done more tweaks to my color palette selector. #gamedev #screenshotsaturday #madewithunity https://t.co/aJXrC4ruRg
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Set up the projection for 2D drawing?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Nyxenon   Members   

104
Like
0Likes
Like

Posted 23 February 2012 - 09:26 PM

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?

#2 karwosts   Members   

840
Like
0Likes
Like

Posted 23 February 2012 - 10:38 PM

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.
My Projects:
Portfolio Map for Android - Free Visual Portfolio Tracker
Electron Flux for Android - Free Puzzle/Logic Game

#3 Nyxenon   Members   

104
Like
0Likes
Like

Posted 23 February 2012 - 11:14 PM

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.