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

You can store an enclosing convex polygon.  I think you can determine if 
a point is inside the polygon using a variation of barycentric 
coordinates.  Or find the interior angles of all triangles defined by 
two adjacent vertices and the point you are checking.  If all interior 
angles add up to 360 then the point is inside.

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.
> ---
> 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
> 
> 
> 
> 


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


Other related posts: