Path: chuka.playstation.co.uk!news From: colin adams Newsgroups: scee.yaroze.programming.3d_graphics Subject: Collision Detection Algorithms Date: Tue, 29 Jul 1997 07:47:21 -0700 Organization: Cobra Developments Lines: 41 Message-ID: <33DE0279.4EB@cobradev.demon.co.uk> NNTP-Posting-Host: cobradev.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I; 16bit) Hello All Here is help with Collision Detection Algorithms, if anyone is Interested. I used some of this stuff in my Demo see-: Hunt Seek Find & Kill PSX Yaroze Demo at-: "http://www.cobradev.demon.co.uk/" (un-ashamed-plug) v.03b Now Available (50 hits in a week & no email, strange). Bounding Cuboid: For each object, find the maximum and minimum of each the x, y and z co-ordinates of all the points in each object. If they don't rotate, this is easy, as it's a constant relative to the centre, if they do, as in most games, and speed is critical as in game environments, stick with bounding spheres. Otherwise it's just comparing these values to see if there's an intersection. It _is_ useful for environments which don't change. Look at "http://www.cs.unc.edu/~hoff/vfculler/viewcull.html" It's not collision, but it covers bounding boxes pretty well. Bounding Sphere: if ((a.x-b.x)^2+(a.y-b.y)^2+(a.z-b.z)^2 < a.radius^2+b.radius^2 ) objects A and B in collision; Calculating the Radius of the Objects: Pick a centre point. You can just average all the points in the object, though the centre of mass may be more convenient for physics modelling. Anyway, pick a centre point. Find square of the distance from each point to the centre: (p.x-c.x)^2+(p.y-c.y)^2+(p.z-c.z)^2, the largest one is the square of your radius. I managed to pre-calculate this successfully via *.Dxf format, as this format is adequately documented. but I would like to pre-calculate this via *.TMD during the Project initialisation. Can anyone help out? BTW if anyone is going to ECTS see-:"http://www.ects.com" for the Latest Information. Keep the Faith. -- Cobra