Jump to content
  • Advertisement

Archived

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

Jumpman

glScalef and Ortho mode.

This topic is 5702 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

I''ve been trying to use glScalef() but is also seems to be scaling the origins of the object (sprite).. is there a way to scale a object via a gl command based on the ortho mode coordinates or is it best to pre-scale the object yourself in the code.. I guess this is comming from the fact that I want to make my stuff resolution independent.. being a 2d game (platform) I know I have n elements up and down so its easy to find to scale factor for the given resolution. for example I need 40 cells accross.. if the player is playing in 1024 res then each cell is 25 pixels, if they are playing in 800 then each cell is 20.. etc.. it would be nice to get openGL to scale things for me based on a screen to map ratio but I guess i can always calc the suff for myself.. any suggestions ?? Cheers Chris

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Just pass a fixed width e.g. 800x600 as width, height to your glOrtho/gluOrtho call, then your viewport always as 800 units width and 600 units height no matter what the "real" dimensions of your window are. There is absolutely no need to manually scale.

c ya,
Tobias

Share this post


Link to post
Share on other sites
thanks will give that a go. I guess you set up a fixed world size and render to that and it will will auto scale.

Cheers

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!