Path: chuka.playstation.co.uk!news From: "Rad" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: 2d collision bounding box... Date: Wed, 9 Dec 1998 21:59:01 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 108 Message-ID: <74mrpa$8bc14@chuka.playstation.co.uk> References: <366C2C7E.75028A95@club-internet.fr> <74hp72$8bc3@chuka.playstation.co.uk> <366DC77E.250F58BA@manc.u-net.com> NNTP-Posting-Host: vil-66.village.gre.ac.uk Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0080_01BE23BF.2114F5A0" X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 This is a multi-part message in MIME format. ------=_NextPart_000_0080_01BE23BF.2114F5A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable How do you manipulate pixels on the yaroze? Rad. rad@cyberdude.com http://www.netyaroze-europe.com/~radpsx James Shaughnessy wrote in message = <366DC77E.250F58BA@manc.u-net.com>... Collision detection in Gravitation is done in a completely stupid = way, but it works. A 15x15 area of VRAM is SaveImage'd to main RAM, and = the ship pixels are drawn on manually checking first if the pixel = (16-bit word) underneath is non-zero. Then, when it's done that it's = LoadImage'd it back to VRAM with a return flag saying if the ship has = hit anything. I think it would be difficult to see this looking at the = source, unless my commenting is particularly spicy. (bear in mind the = ships are of course not actually GsSprites)=20 The sane way to do it would be to draw the ships using sprites as = usual, but have copies of the sprites in arrays (perhaps in 1-bit form) = and check the pixels using bit masking (with &). This would prove = much faster (as the collision detection is not time-dependant on the = actual GPU drawing). This is the way I do bullet-background collisions = (bullets are actually 1x1 sprites) -- the 640x512 maps are stored in a = 1-bit 40K area of RAM (created runtime as the map is being decompressed) = ------=_NextPart_000_0080_01BE23BF.2114F5A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
How = do you manipulate pixels = on the yaroze?
 
Rad.
rad@cyberdude.com
http://www.netyaroze-eur= ope.com/~radpsx
James Shaughnessy wrote in message <366DC77E.250F58BA@manc.u= -net.com>...
Collision detection in Gravitation is done in a = completely=20 stupid way, but it works.  A 15x15 area = of VRAM is=20 SaveImage'd to main RAM, and the ship pixels are drawn on manually = checking=20 first if the pixel (16-bit word) underneath is non-zero. Then, when = it's=20 done that it's LoadImage'd it back to VRAM with a return flag saying = if the=20 ship has hit anything.  I think it would be difficult to see = this=20 looking at the source, unless my commenting is particularly spicy.  (bear in mind the ships are = of course=20 not actually GsSprites)=20

The sane way to do it would be to draw the = ships=20 using sprites as usual, but have copies of the sprites in arrays = (perhaps in=20 1-bit form) and check the pixels using bit masking (with=20 &).    This would prove much faster (as the = collision=20 detection is not time-dependant on the actual GPU drawing).  = This is=20 the way I do bullet-background collisions (bullets are = actually 1x1=20 sprites) -- the 640x512 maps are stored in a 1-bit 40K area of RAM = (created=20 runtime as the map is being decompressed) =

------=_NextPart_000_0080_01BE23BF.2114F5A0--