Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: jamin1@psu.edu (Jamin Frederick) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: pixels Date: Fri, 11 Jul 1997 02:09:03 GMT Organization: SCEA Net Yaroze News Lines: 40 Message-ID: <33c59528.31005864@news.scea.sony.com> References: <33c122d9.168381829@news.scea.sony.com> <33c3d7f6.4808700@news.scea.sony.com> NNTP-Posting-Host: nbppp42.cac.psu.edu X-Newsreader: Forte Free Agent 1.11/32.235 On Wed, 09 Jul 1997 18:31:17 GMT, jamin1@psu.edu (Jamin Frederick) wrote: >On Mon, 07 Jul 1997 20:22:09 +0100, ira@netcomuk.co.uk (Ira Rainey) >wrote: > >>In article <33c122d9.168381829@news.scea.sony.com>, jamin1@psu.edu (Jamin >>Frederick) wrote: >> >>> Hi, how's it going? I'm working on my pixel-by-pixel collision >>> detection algorithm, and I've run into a problem of actually trying to >>> access pixel data of sprites. It seems like I won't be able to access >>> the data the lies in the video memory once it has been transferred >>> from the main memory, since there are no api calls to do this >> >>It's just a thought, but how about setting yourself an area of memory >>aside, the size of the bounding box of your sprite, as a buffer. Then when >>you want to test to see if a collision has occured, first test the >>bounding box area, if that is true then copy that bounding box into your >>main memory area buffer using StoreImage(); then test it there. If the >>pixels collide you can run your collision stuff, if not drop back to the >>main loop. >> > In fact, I would only need to copy the *intersection* of the >two sprites' bounding boxes, both the same size, a section from each >sprites' image, into main memory with StoreImage(). The question is, >whether StoreImage() is fast enough to be doing transfers pretty >frequently, probably almost every frame or so. > I'll try this method and see if I have any problems. >Otherwise I'll use the main memory comparison thing. > Now that I think about it, I'd need 4 StoreImage()'s, one for each sprite and one for each CLUT! And we're supposed to do a DrawSync(0) after each one! Hmm, maybe main memory is a better deal... Jamin >