# calc campos

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

## Recommended Posts

hey, i currently have a basic game setup with a character and a camera behind the character. my goal is to make the cam moveable all around the character, like if there is bowl placed over the char. so basically a 3rd personview, like you see in most MMO games. my question is, what is the formula for this?? i already have the cam placed behind the char, at a certain distance. so i already have the data i need, i just don't know how to calculate what i want. my vars camDistance camPos.x camPos.y camPos.z and if needed charPos.x, y and z could someone please help me out with this...??

##### Share on other sites
How do you want to control the position (angle) of the camera relative to the player?

One common choice is to use two angles: a "phi" or "altitude" (angle above the ground: 0 = holding the camera level, 90 degrees = looking straight down), and a "theta" or "azimuth" (angle around the player); and a distance: the radius of the bowl you're imagining.

To convert these angles into a position, you convert from these so-called "spherical" coordinates to "cartesian" (rectangular) coordinats (i.e. the ones with .x/.y/.z values), and then offset by the player's position.

Try these Google results to figure out the conversion and find some diagrams.

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
17
5. 5

• 14
• 29
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631773
• Total Posts
3002265
×