Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Collision Detection Algorithms Date: Tue, 29 Jul 1997 09:42:52 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 52 Message-ID: <33DDAD0C.28A3@interactive.sony.com> References: <33DE0279.4EB@cobradev.demon.co.uk> NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) To find the centre from the vertex points using .TMD format, find the document TMDformat.doc on the SCEE website, probably under 'manual additions'. This lists TMD format in its entirety. Many of the SCEE demos directly access TMD data directly, hence showing how to create or read TMDs; using this, reading vertex data should be fine. colin adams wrote: > > 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