Original Post
Discalimer: This is more of a mental exercise than anything else, so feel free to throw out just about anything ^_^ I was thinking the other day of how one might make a camera for a 3D "Smash TV" type multiplayer shooter. I sketched out a few quick diagrams to see how you might do it, but from my inital look at the problem, it would seem that you don't have enough information to solve this. I was wondering if anyone had any insight for me. Camera rules: The theoreical game is played from a top-down or 45 degree angle view, and aim is determined by a free-moving cursor that is independant of your charecters movement. Because of this, it would be desirable if your view always showed you the same amount of the playing field both above your charecter and below him. Additionally, we want the player to be able to adjust the camera to the view that they like best BUT we don't want certain angles to give an advantage ove others. Once again, we need to keep the same veiwable distance before and after the player. The way I see it, there are two styles of camera control that would fit these requirements. Either: A) The user controls the distance of the camera from their avatar, and the game calculates the angle of the camera based on that or B) The user specifies the angle of the camera and the game then calculates it's distance from the player. These two approaches graph something like this:
in both diagrams f represents the Field of View and v is the desired visible distance before and after the player (therefor 2v is the total viewable distance.) In "A" d represents the desired distance of the camera from the player, and therefore the goal is to solve for the unknown angle shown by "?". In "B", d represents the angle of the camera to the floor, and so the goal is to solve for the distance from camera to player shown as "?" Right off the bat, it would seem that these are unsolvable with the variables given, so we may need to add some extra parameters to the system or calculate based off of a different variable. (For example, perhapse we could instead let hte player control the distance of the camera from the floor, not the player. That would give us a nice right-triangle ^_^) Anyone have any comments/guesses/pointers?
in both diagrams f represents the Field of View and v is the desired visible distance before and after the player (therefor 2v is the total viewable distance.) In "A" d represents the desired distance of the camera from the player, and therefore the goal is to solve for the unknown angle shown by "?". In "B", d represents the angle of the camera to the floor, and so the goal is to solve for the distance from camera to player shown as "?" Right off the bat, it would seem that these are unsolvable with the variables given, so we may need to add some extra parameters to the system or calculate based off of a different variable. (For example, perhapse we could instead let hte player control the distance of the camera from the floor, not the player. That would give us a nice right-triangle ^_^) Anyone have any comments/guesses/pointers?