Archived

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

Jumpman

glScalef and Ortho mode.

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