• ### Popular Now

• 12
• 27
• 9
• 9
• 20

#### Archived

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

# quick question

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

## 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 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

before:
drawsquare(y)
after:
drawsquare(I_Y(y));

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