View Full Version : Ring conforms to the circumference of sphere

12 December 2008, 10:37 AM
Not a script question per say but a math related one.
1. a sphere of radius: 100
2. a circle shape of radius: 100
3.I align the circle to the sphere

I want the circle to start with radius 100 and when i take it(or animate) down to the bottom of the sphere(pole) it should zero out in radius.

Ring conforms to the circumference on each step of it's way down.
What would the math be in this situation.

i could hack this by:
1.At each step along it's down path(circle Pivot) shoot a ray to the sphere and use the the magnitude to drive the radius.

but that wont further my mathematical understanding of the problem.

Thanks for any help.


12 December 2008, 11:16 AM
sphRad is the radius of the sphere and
posZ is the distance of the ring when travelling along the axis of the sphere
then the value
squareRoot(sphRad*sphRad - posZ*posZ)
if applied to the radius of the ring, the ring should confirm exactly to the circumference of the sphere.
posZ needs to be evaluated wrt the sphere's pos.
You could use the math as either an expression or a float script on the radius of the ring.


12 December 2008, 11:25 AM
as far as maths goes in 3D: triangles are king! see my super amazing diagram below :)

In the above diagram:
r = the radius of the sphere
d = the distance away from the center of the sphere
x = your new radius

so its a simple trig calculation. the old c^2 = a^2 + b^2 or in this case r^2 = d^2 + x^2
so we rearrange the equation so that we can solve for x:
x^2 = r^2 - d^2
x = sqrt (r^2 - d^2)

EDIT: arg aaaaCHoooo you beat me to it!

12 December 2008, 11:43 AM
EDIT: arg aaaaCHoooo you beat me to it!

Actually both were EXTREMELY helpful.
One was concise and the other visual.
The penny has dropped :thumbsup:


CGTalk Moderation
12 December 2008, 11:43 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.