• Advertisement
Sign in to follow this  

camera viewing multiple players

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

Hi all, I'm writing a small tank battle game with mostly 2d gameplay but 3d graphics. Each player controls a tank, and the tanks move around on a 2d map which a camera views from overhead. I'm trying to find a way to have the camera move around smoothly to view all players in the map, zooming in when all players are in one area and backin off as they spread apart. It will be similar to the camera style in Smash Brothers if you have played that. So does anyone know of an article about this type of camera or its industry jargon name so I can google for it? Thanks in advance for any help, - InfestedFurby

Share this post


Link to post
Share on other sites
Advertisement
How is the camera looking at the tanks?
from the top to the bottom?

Share this post


Link to post
Share on other sites
A very easy thing to do...

Just remember your high school trigonometry...

1. Work out the bounding-box of your players.
2. Set X,Z coordinates of camera to the center of the bbox.
3. Based on your FOV (a known constant), work out how far above (Y) coordinate, you're going to need to be, in order to have the entire bbox in view.

Share this post


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

  • Advertisement