Jump to content
  • Advertisement

Archived

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

ShmeeBegek

Sphere...

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

Suppose there is a sphere sitting on the origin (0,0) of size 1. I need to calculate a point on the sphere using two rotational values x and y, and get an x,y,z coordinate of the point around the outside of the sphere. I have been trying to do this for weeks, please help! Sorry for abruptness I am very sick, ~SPH

Share this post


Link to post
Share on other sites
Advertisement
I''m not sure exactly what you mean by the two rotational values. The standard parametric equation for a unit sphere is (cos(theta)*sin(phi), sin(theta)*sin(phi), cos(phi)). Theta is a rotation around the z axis while phi is an angle with the z axis. With longitudes and latitudes you switch the sines and cosines of phi. That way zero degrees latitude is the equator, not the pole. There are a lot of other variations, but those are the basic two.

The main thing you have to remember is that (cos(t),sin(t)) is a unit circle centered at the origin. You are just drawing a set of circles where the radius varies from zero to one and back to zero. Sine does that as you go from zero to pi (180 degrees) and cosine does it as you from from -pi/2 (-90) to pi/2 (90).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!