Sphere intersection algorithm help needed

From: BCC (bcc_at_akanta.com)
Date: 03/22/05


Date: Tue, 22 Mar 2005 19:11:14 GMT

Hi,

I have a 3D Matrix application in C++, where I want to represent a sphere
(surface only) inside my matrix. So for example, if my matrix is
100x100x100, and I want to have a sphere with center 50,50,50 r=40, I would
need to generate a list of all matrix units whose volume intersects the
surface of the sphere. Then I can use these units to make a rough
approximation of the sphere.

I have been using a^2 + b^2 + c^2 = r^2, iterating through all of the units
in my matrix and testing each one to see if it falls on the spheres surface.
This works, but it obviously only picks up those units whose xyz coordinates
fall exactly on the surface.

I thought about trying to find a sphere-cube intersection algorithm, but a)
couldnt find one and b) Im not sure this is a good approach... do I want a
unit whose corner barely touches the sphere to be included?

So I then thought about a sphere-sphere intersection algorithm, but again
couldnt find one. So I think if it makes sense, I would need an algorithm
to test the following:
Given: Sphere 1, center x, y,z and radius, and Sphere 2's center x,y,z and
radius, does the surface of Sphere 1 intersect Sphere 2?

Can someone point me to an algorithm for this or offer some suggestions? Im
not a math guy, so Im not even sure what to look for which is why maybe
google is failing.

Thanks,
Bryan



Relevant Pages

  • Re: Fit sphere to planar circles
    ... My approach so far has been to use hough circle detection in the area of = ... sphere regions of the sphere, and I am using some logic = ... I have a similar problem and I abandoned the hough transform. ... normalization though) at the radius of interest. ...
    (comp.soft-sys.matlab)
  • Re: Question about analysis of Schwarzschild solution on Fo. of Phys. 1988, 18, 6
    ... "On the gravitational field of a sphere of incompressible fluid ... for the mass point. ... The Schwarzschild radius. ...
    (sci.physics.relativity)
  • Re: average distance between points inside or on a sphere
    ... between two points in a ball of radius R. ... correspond to a circular slice through the sphere with radius r2; ... the intersection with the surface of the sphere of a line ... element divided by the total surface area of the sphere, ...
    (sci.math)
  • Re: a new Yahoo Group for "Dance of the Planets"
    ... > change in density of the mass results in changing the shape of the space ... > wood sphere with a 3 kilogram sphere of Lead or Iron notice how much more ... The Sun's mass and radius are about: ... The density of balsa wood varies from about 5 to 20 pounds per cubic foot. ...
    (sci.astro)
  • Re: Curved space-time?
    ... how do you fuse/combine space (the general absence of matter) and ... Where A is the surface area and r the radius of the sphere. ...
    (sci.physics)