View Single Post
Old 05-01-2008, 09:18 AM   #1582
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,775
How do you tell if a 3D surface (transparent or not) is touching another 3D surface?

There's a technique called Bounding Boxes, in which you set up the imaginary corners of a box around each object, then constantly test all those points to see if they are "within" another bounding box. Unless your objects are rather square to begin with, the boxes would be a pretty loose fit, preventing the objects from getting very close. Bounding Spheres are better for round objects, but what about something like a Finger Coral?

I actually have come up with a pretty good scheme, and was hoping to have a test version in the hands of the Alpha team last night. But there were some bugs that sent the fish hopping around uncontrollably, so it will take another day. (I will lose part of the day today, as it's our 26th anniversary, and my wife has two Shakespeare plays and a dinner planned.)
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote