# spherical coordinates

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

## Recommended Posts

hi all.. i'm developing a game that is going to involve playing on the surface of an invisible sphere, surrounding an object in the center. i've had much trouble coming up with proper mathematics to do this, using spherical coordinates isn't quite working out well enough. i think what i need is some way of computing the plane along the tangent of a point on the surface of the sphere (the 'current position') and computing the arc of motion, then using the points along that arc (recomputing if the velocity direction changes if so required at each stage)... but i'm a bit hazy on how to do this exactly.. any pointers, or some other method of accomplishing the same thing? thanks chris.

##### Share on other sites
Exactly what you should do depends entirely on how you are implementing your system and how physically accurate you want it to be. If you have a look at lagrangian mechanics you'll see how to calculate the motion of a constrained particle (eg a bead on a wire). If you want to handle linear velocities, then (assuming the distance moved per frame is small compared to the sphere) you could simply consider the motion as linear and project it down onto the sphere. This works because a sphere is locally flat (this doesn't need real physics). If you want the player to be attached to the sphere by gravity, and you have a physics simulation, then you could have a genuine gravitational field attracting the player. None of this is mathematically that complex. I'm guessing the vector projecting method should be the simplest. You are simply storing cartesian coordinates in the normal way, with a coordinate system centred on the sphere, then normalising them to the spheres radius.
Hope this helps,

Dan

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 13
• 9
• 12
• 9
• ### Forum Statistics

• Total Topics
631438
• Total Posts
3000073
×