[gameprogrammer] Re: Looking for a good storage method.
- From: Frank Herrera <frankherrera@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 27 Oct 2004 08:32:15 -0600
Hi,
I was going to ask if those links should be put on the Wiki somewhere
(especiallyu the second one). That FAQ looks very thorough!! But I
won't have a chance to peruse it until later :)
Frank
On Wed, 27 Oct 2004 09:03:40 -0500, Bob Pendleton <bob@xxxxxxxxxxxxx> wrote:
> 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.
>
> 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.
>
> 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.
>
> Bob Pendleton
>
> > ---
> > 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 +
> +--------------------------------------+
>
>
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Looking for a good storage method.
- From: jclark
- [gameprogrammer] Re: Looking for a good storage method.
- From: Bob Pendleton
Other related posts:
- » [gameprogrammer] Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- » [gameprogrammer] Re: Looking for a good storage method.
- [gameprogrammer] Looking for a good storage method.
- From: jclark
- [gameprogrammer] Re: Looking for a good storage method.
- From: Bob Pendleton