Advertisement

How about "bounding ellipsoilad spheres"? :P

Started by September 02, 2000 08:16 AM
0 comments, last by kieren_j 24 years, 5 months ago
Hi, I just had a good idea that''s as easy as bounding spheres but 3 times more accurate...how about bounding spheres, but instead of a single radius, it''s scaled to fit the max x,y,z bounding box (like an ellipse, except in 3d). I''m not sure how I''d test for this, would this work: [pre] xdist = abs(object1.x - object2.x); ydist = abs(object1.y - object2.y); zdist = abs(object1.z - object2.z); abx = sqrt((xdist*xdist)+(ydist*ydist)); aby = sqrt((xdist*xdist)+(zdist*zdist)); adz = sqrt((ydist*ydist)+(xdist*xdist)); if ( (abx < (object1.xsize + object2.xsize)) && (aby < (object1.ysize + object2.ysize)) && (abz < (object1.zsize + object2.zsize)) && { // collision } else { // no collision } [/pre] I''m pretty much 103% sure that this will not work. Any other ideas behind the math? thx --------------- kieren_j ÿDesigned for Win32
IIRC there was tutorial on flipcode about collision detection using ellipsoids? a couple of months ago

This topic is closed to new replies.

Advertisement