quick hacky solution - apols, but on the way out :p

you could divide up the screen into rects and have a list of points within each division which will cut down your search.

e.g if inside(the mouseloc, rect1) then
check distance using pythag between your mouseloc and the points in your sublist inside that rect.

hackie voila.

hth, off to the pub :)

julian

On 11 Apr 2006, at 19:26, Tim Welford wrote:

Hi Guys,

I'm hoping someone can help me out with a quick pointer, I've got a
tight deadline and my minds gone a bit blank.

I have a list of points....

[point(112,456), point(12,485), ...] list goes to about 50

These are actually co-ordinates of certain pixels on my stage.

I need to find the closest one (radius) to any given point - i.e. the
mouseLoc - it needs to be fairly efficient as I will need to do it every
frame \ couple of frames.

Can someone point me in the right direction please.

Many thanks

Tim





[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to