Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Khaos Dragon

quick question

This topic is 5662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Yes this is a quick question and probably pretty stupid but I just wanted to doublecheck. Right now in my ogl program I have 3d mode for the game and an ortho2d mode to display the actual interface. Now the problem is that the coordinate systems used for my text outputter and my 2d graphics are different. The text outputter uses the screen widths and height as its coordinates with 0,0 being on the bottom left. If I were to call gluOrtho2d( 0, SCREEN_WIDTH, 0, SCREEN_HEIGHT ) would that match the coordinates, and I realize that the y axis is reversed but my code is already coded with that in mind so I want it to be reversed. Again I apologize if I am wasting your time but I just wanted to make sure I understood before I totally revamped my code (and yes I have backed it up but still...)

Share this post

Link to post
Share on other sites
as long as you have SCREEN_H

then make a quick inline function called

inline float I_Y(float y)
return SCREEN_H - y;

and place that whenever you call your 2d functions, so


"you are the poet laureat (sp?) of programming. ALL HAIL!!!" -capn_midnight
A Link for programming drunks

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!