View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

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

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

Posted 29 May 2013 - 09:27 AM

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:

Edited by RookieCookie, 29 May 2013 - 09:40 AM.

### #2japro  Members

Posted 29 May 2013 - 09:30 AM

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

Posted 29 May 2013 - 09:36 AM

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

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

### #4japro  Members

Posted 29 May 2013 - 09:41 AM

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.

Posted 29 May 2013 - 09:43 AM

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

Posted 29 May 2013 - 09:47 AM

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?

Posted 29 May 2013 - 09:52 AM

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

Posted 29 May 2013 - 10:19 AM

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 But thanks anyway

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.