Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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.

  • You cannot reply to this topic
7 replies to this topic

#1 RookieCookie   Members   -  Reputation: 102

Like
0Likes
Like

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:

rFIAwN3.png?1


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


Sponsor:

#2 japro   Members   -  Reputation: 887

Like
1Likes
Like

Posted 29 May 2013 - 09:30 AM

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



#3 RookieCookie   Members   -  Reputation: 102

Like
0Likes
Like

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 :)



#4 japro   Members   -  Reputation: 887

Like
0Likes
Like

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.



#5 lask1   Members   -  Reputation: 794

Like
0Likes
Like

Posted 29 May 2013 - 09:43 AM

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



#6 RookieCookie   Members   -  Reputation: 102

Like
0Likes
Like

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? :o



#7 Paradigm Shifter   Crossbones+   -  Reputation: 5432

Like
1Likes
Like

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

#8 RookieCookie   Members   -  Reputation: 102

Like
0Likes
Like

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 :D 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.



PARTNERS