Jump to content
  • Advertisement
Sign in to follow this  
RookieCookie

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

This topic is 2023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Edited by RookieCookie

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!