RTS Zoom in and Zoom out, how do they do it?

Started by
6 comments, last by RookieCookie 10 years, 10 months ago

Hello!

I'm just wondering, in an rts game you can zoom in and out. How do they do it? I mean the units are getting scaled up, but they're also increasing the space between each game object, how?

NB

2D not 3D

I wasn't sure if to put this question in game design or programming, so sorry!

Explanation image:

rFIAwN3.png?1

Advertisement

You usually don't actually scale any objects, you just change the "camera transform".

You usually don't actually scale any objects, you just change the "camera transform".

That's 3D, I'm talking 2D :)

So? Doing 2D means you are using a orthogonal projection, or at least its equivalent to doing that. You can always treat 2D as a special case of 3D.

2D or 3D it does not matter it still should be a camera transformation.

2D or 3D it does not matter it still should be a camera transformation.

Well, then atleast could someone explain me how a 2D camera zoom in works? I know how to do x and y movement, but zoom in? :O

You change the clip planes so they are closer together or further apart (while keeping the aspect ratio the same). That's for orthographic anyway, in perspective you change the field of view.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

You change the clip planes so they are closer together or further apart (while keeping the aspect ratio the same). That's for orthographic anyway, in perspective you change the field of view.

Shit, I'm so stupid. I'm using slick2D which has a g.scale method which does the job :D But thanks anyway

This topic is closed to new replies.

Advertisement