glScalef and Ortho mode.
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
May 02, 2003 05:05 AM
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
c ya,
Tobias
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement