Structural

11-28-2002, 11:25 PM

I've posted this question on the Planetarion forums too ( http://pirate.planetarion.com/forum/showthread.php?s=&threadid=154550 ) and I've gotten a formula that detects intersection of two ellipsoids:

[(x1-x2)/(w1+w2)]^2 + [(y1-y2)/(h1+h2)]^2 + [(z1-z2)/(d1+d2)]^2 <= 1

The slight problem is that the ellipsoids HAVE to be alligned to the axes for the formula to work, but I also want to detect collisions when the objects are rotated randomly in space.

Does anyone happen to know how to accomplish this... how to alter the width/height/depth of the ellipsoid to be able to use the formula, or any other formula that'd work?

TY

[(x1-x2)/(w1+w2)]^2 + [(y1-y2)/(h1+h2)]^2 + [(z1-z2)/(d1+d2)]^2 <= 1

The slight problem is that the ellipsoids HAVE to be alligned to the axes for the formula to work, but I also want to detect collisions when the objects are rotated randomly in space.

Does anyone happen to know how to accomplish this... how to alter the width/height/depth of the ellipsoid to be able to use the formula, or any other formula that'd work?

TY