[gameprogrammer] Re: Looking for a good storage method.

Thanks everyone.  I will be spending a little quality time reading these =
links Bob.  The rectangle list is actually how I implemented the =
bounding boxes, actually a doubly linked list sorted first by Y they by =
X with two values, a min and max value, for quick testing.  Thanks for =
the links Bob, I'll let you know how it goes!
Jason.

> -----Original Message-----
> From: gameprogrammer-bounce@xxxxxxxxxxxxx [mailto:gameprogrammer-
> bounce@xxxxxxxxxxxxx] On Behalf Of Bob Pendleton
> Sent: Wednesday, October 27, 2004 8:04 AM
> To: Gameprogrammer Mailing List
> Subject: [gameprogrammer] Re: Looking for a good storage method.
>=20
> On Tue, 2004-10-26 at 20:54, jclark wrote:
> > I have irregular shaped objects that I need to check for mouse =
clicks. I
> am storing an outer bounding box for a quick check to see if the mouse
> click occurred in a possible area of the object, but if that returns =
true,
> I need to see if the mouse click actually occurred in the object. Any
> ideas on ways to store a representation of the data without storing a =
huge
> array of pixels?
> > Thanks,
> > Jason.
>=20
> There are two methods that are usually used to solve that problem. =
Which
> you use depends on the problem you are trying to solve. If you have to
> detect intersecting and overlapping objects it is best to use a
> rectangle list sorted first by Y and then by X of the upper left hand
> corner. This is the next step up from a single bounding box. You can =
do
> intersection operations on a rectangle list very quickly. It can =
handle
> an object with any shape. It can handle objects with holes. All in =
all,
> very handy.
>=20
> For simpler case just create a bounding polygon and use a point in
> polygon test to see if the cursor has entered the polygon. You can =
find
> some very nice PNP code at:
> http://www.ecse.rpi.edu/Homepages/wrf/research/geom/pnpoly.html and =
also
> at http://www.faqs.org/faqs/graphics/algorithms-faq/ in section 2.03.
> Anyone doing graphics needs to know about the graphics FAQ and should =
at
> least skim the last link I listed.
>=20
>               Bob Pendleton
>=20
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.775 / Virus Database: 522 - Release Date: 10/8/2004
> >
> >
> >
> >
> > ---------------------
> > To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> >
> --
> +--------------------------------------+
> + Bob Pendleton: writer and programmer +
> + email: Bob@xxxxxxxxxxxxx             +
> + blog:  www.Stonewolf.net             +
> + web:   www.GameProgrammer.com        +
> +--------------------------------------+
>=20
>=20
>=20
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>=20
>=20
>=20
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.775 / Virus Database: 522 - Release Date: 10/8/2004
>=20

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 10/8/2004
=20


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: