glTranslate or glOrtho to move camera on a 2D game?
Hi dudes!
I'm doing a 2D platform game and I'd like to know how do you usually move a camera in this kind of games, using glTranslate or glOrtho? Why?
Thanks.
I'm doing a 2D platform game and I'd like to know how do you usually move a camera in this kind of games, using glTranslate or glOrtho? Why?
Thanks.
glTranslate is the usual way. I hadn't thought of using glOrtho, but I can't think of a reason off the top of my head that it wouldn't work...
ThemsAllTook Wrote:glTranslate is the usual way. I hadn't thought of using glOrtho, but I can't think of a reason off the top of my head that it wouldn't work...
Hi! Thanks for reply.
Let's say I use glTranslate to move my camera (and rotate it for lanscape mode)
How can I do zoom???
Thanks.
riruilo Wrote:How can I do zoom???
Use glScale
"When you dream, there are no rules..."
Taxxodium Wrote:Use glScale
Ohh that's true. So using glScale I avoid calling glOrtho, am I right?
Thanks a lot
Well, you still have to set up your projection matrix with glOrtho, but we don't typically use it for anything else. So yes, translate/rotate/scale your modelview matrix for anything else, like a virtual camera.
AnotherJake Wrote:Well, you still have to set up your projection matrix with glOrtho, but we don't typically use it for anything else. So yes, translate/rotate/scale your modelview matrix for anything else, like a virtual camera.
OK, thanks a lot.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Move in direction of camera | MikeD | 3 | 3,795 |
Aug 18, 2010 07:33 AM Last Post: MikeD |
|
| png to pvrtc move | kendric | 8 | 5,571 |
Jul 1, 2009 04:49 AM Last Post: arekkusu |
|
| Make the terrain move with the character | chrism | 9 | 4,117 |
May 20, 2009 04:15 PM Last Post: chrism |
|
| how can I move out this bar please ? | imaumac | 5 | 3,264 |
Oct 12, 2008 08:14 PM Last Post: imaumac |
|

