Archived

This topic is now archived and is closed to further replies.

wingman20

math

Recommended Posts

What is the formula for a point on a sphere? i know there are two formuli (or is it formulas) for a circle: x=r*sin(a)+x1 y=r*con(a)+y1 (i think) but is there a simalar formula for a sphere? I am using this for positoining the camera and target in my game (the target should allways be on the surface of an immaginary sphere arround the camera) Is this meathod the best or is there another meathod that is faster? thanks

Share this post


Link to post
Share on other sites
Well if you''re using coordinates and angles, you''re going to need 2 angles in order to represent 3 dimensions. a is the angle in the x/y plane, you need an angle in the x/z or y/z plane.

Of course, I am almost certain that there is a better way to do it using vector maths, but I don''t know it

This much is true though, if you want to check if your point lies on the surface of that sphere:

(x1 - x)² + (y1 - y)² + (z1 - z)² = r²

Harry.

Share this post


Link to post
Share on other sites