Sphere intersection algorithm help needed
From: BCC (bcc_at_akanta.com)
Date: 03/22/05
- Next message: Albert Wagner: "Re: Epistemology 201: The Science of Science"
- Previous message: Dave Seaman: "Re: Distinct linear orderings on Z"
- Next in thread: Don Taylor: "Re: Sphere intersection algorithm help needed"
- Reply: Don Taylor: "Re: Sphere intersection algorithm help needed"
- Reply: Daniel W. Johnson: "Re: Sphere intersection algorithm help needed"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Albert Wagner: "Re: Epistemology 201: The Science of Science"
- Previous message: Dave Seaman: "Re: Distinct linear orderings on Z"
- Next in thread: Don Taylor: "Re: Sphere intersection algorithm help needed"
- Reply: Don Taylor: "Re: Sphere intersection algorithm help needed"
- Reply: Daniel W. Johnson: "Re: Sphere intersection algorithm help needed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|