Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Collision Detection in a 3d Environment. Date: Fri, 13 Jun 1997 09:47:47 +0100 Organization: Sony Computer Entertainment Europe Lines: 75 Message-ID: <33A10933.7CB7@interactive.sony.com> References: <339E12F6.36F6@cobradev.demon.co.uk> Reply-To: N/A-Use-Newsgroup 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) colin adams wrote: > > Hello All > > During the course of a Game one of the main functions that the > Game must perform is Collision Detection. Both -: > (a). Environment to Characters. > (b) Character to Character. > > The Documentation I possess regarding this subject is sparse, to put it > mildly. > > My Questions are-: > > 1. Which Method is Best? > The Method I used in my 2d projects was the "Bounding Box algorithm". > Is this method applicable to 3d? I have heard of a "Bounding Sphere > algorithm" But I haven't seen/got any info on it. > Has anyone any Documentation regarding this Subject? > Two of the simplest methods are bounding sphere and bounding cuboid. For bounding sphere, testing two objects to see if they collide is just testing the distance between them versus the sum of the two collision radii, i.e. objects A and B in collision iff {(Ax-Bx)**2 + (Ay-By)**2 +(Az-Bz)**2} // square of distance < (A.collisionRadius + B.collisionRadius)**2 // square of legal dist For bounding cuboid, it's just bounding rectangle extended; for detection to be very fast, cuboids must be aligned in world i.e. not rotated at arbitrary angle. It really is just using bounding rectangle with an extra dimension check. > 2. When Creating Environment Blocks in a Modeler are there any > Special Considerations to Consider Regarding Collisions i.e. XYZ+- > ect. Given that collision detection is often a substantial CPU time-consumer, people often choose a fast algorithm and design a world around it (eg using bounding cuboids, and making the world out of 3d grid blocks and spaces). It depends how much collision detection you need to do, and how much time it will actually take under different world descriptions / polygonal building blocks. > > 3. Has any One got any Environment Blocks I could use for Reference? > This is so I can see if I created my Models Correctly as I do not have > any > Info to Refer to. I have a Modeler & I created the blocks in my Project > Myself, > & I'm not sure I have done them correctly as the Frame Rate is Starting > to suffer > a Bit When I texture the Objects. This may just be due to the number of objects and size/detail of the textures, rather than any actual errors in creation. > > 4. Can anyone point me in the direction of any Demos/Information/Sites > ect > Which Has any Environment Blocks/Collision Detection information? > > I would be Grateful if any postings regarding this post could be sent to > my IP > Address as Well as the NewsGroup. > > Thanks in Advance > > -- > Cobra