Jump to content
  • Advertisement
Sign in to follow this  
d000hg

Feel like a NOOB again (RTS camera driving me mad)

This topic is 4852 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

I just can't seem to get a camera I like for my RTS game. It's a 3D game with a heightmapped terrain, but the view is to be similar to the classic RTS games like Warcraft, C&C, Total Annhilation etc. So far I've tried a top-down perspective camera, but to get the visable area of the map small enough the camera was so close to the ground that units on tops of hills were 2X as big as ones at a lower height, and also it just looked funny because the camera was directly above the centre of the screen, not the bottom left corner! Then I tried an orthogonal view but that made it so you couldn't tell the terrain was 3D! I want something similar to an isometric view, but units in the bottom-left corner of the screen should be seen directly from above. And to stop the problmes of units on hills being too close to the camera, do I need a really low FOV angle - I'm using the classic PI/4 but maybe it should be more like PI/20 for this? I feel pretty dumb asking for help on this, but I just don't have hours to fiddle away with this being for 4E4, and having so much left to implement! Thankyou.

Share this post


Link to post
Share on other sites
Advertisement
I think a possible sollution would be to raise camera position (try kind of 30 real world meters) so even the closest unit will only be a bit bigger than the farthest. Why?

d_close = distance from camera to closest unit position
d_far = same for farthest unit position
unit_close_size - apparent unit size for close spot
unit_far_size - apparent unit size for far spot

d_close/d_far = unit_close_size/unit_far_size = proportion

The 'proportion' value should be a near 1 value (you said it is like 1/2 or less).

d_far = d_close + unit height difference

So, in order to have a good proportion between unit sizes the distance between camera and closest unit should be MUCH BIGGER than the difference between unit positions.

Good luck!

Having a smaller FOV will also help (I think you will need to adjust it), try 70.

Share this post


Link to post
Share on other sites
Yeah, I'd ahve to reduce the FOV. If I double the height of the camera, then the area of the map shown on screen will double too, and all the units will be half the size. To keep things the same size I'd have to halve the FOV.

Now what about getting the camera 'sitting' at the bottom-left of the screen, looking up and right in an isometric style? I've tried rotating it but everything goes wrong. Maybe it's the projection matrix I need to change to some offset perspective transform?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!