Path: chuka.playstation.co.uk!news From: Jake Turner Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Collision detection with rotating sprites Date: Thu, 03 Dec 1998 18:52:35 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 54 Message-ID: <3666DDF3.EBEFDB1E@cthullu.freeserve.co.uk> References: <01be1d86$03a1a160$0a3ddec2@guildfoc> <742u50$9lv3@chuka.playstation.co.uk> <01be1e90$e7e94160$0a3ddec2@guildfoc> <746eq9$c3e2@chuka.playstation.co.uk> NNTP-Posting-Host: modem-61.cobalt.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Boy is this when collision detection gets nasty, (the real nasty problem is when you into 3D with rotations !). How about doing simple rectangle bounding box detection first (simple approximation) and then doing the proper tests. This is the standard way of filtering out the majority of cases whilst using simple maths. e.g. the rectangle bounding box for each sprite would have dimensions diagonal length of sprite * sin(rotation angle) , cos(rotation angle) Then use the centre of each sprite +/- the bounding box dimension/2 Cheers George Bain wrote: > Hi Miles, > > Yes, it is hard to use spheres when using rectangular obejcts. > I had an example demonstrating that in some cases a bounding sphere > will fail(rectangles) in the NY tutorial. I would therefore > split the rectangle into sizes similiar to the colliding object. > > George@SCEE > > In article <01be1e90$e7e94160$0a3ddec2@guildfoc>, miles@guildfrd.demon.co.uk > says... > > >The reason I have to do this is that the sprite in question is a rectangle > >at least twice as long as it is wide - so I use two bounding boxes/spheres. > > > > > >- Miles > > > > > > > > > > -- Jake Turner : Token Rocket Scientist ========================================= Practice VI it may save your life one day Home e-mail: jaket@cthullu.freeserve.co.uk Work e-mail: jaket@revolution.co.uk