RE: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-20 Thread Jesse Graupmann
@chattyfig.figleaf.com Subject: [Flashcoders] Grid / Math - getting neighbouring positions Hello list, I have the following grid and would like to find the neighbouring positions of a certain point, going in a radius from in to out, covering all the positions. [0,0] [1,0] [2,0] [3,0] [4,0] [0,1

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-20 Thread Charles Parcell
Perhaps it is just me but your solution and does not get all the grid locations. All this does is get the grid locations in a direct horizontal, vertical and 45 degree angle from the starter grid. Go out 2 or 3 levels and you quickly find that there are grid spots missing. Charles P. On

RE: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-19 Thread Danny Kodicek
I'll take it ;) thanks for everybody's help. Just catching up on this, you might want to try looking up floodFill algorithms - that's pretty much what you're doing. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options

RE: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-18 Thread Merrill, Jason
That is a nice solution, but it leaves me with the problem that starting from one point (3,2) it only produces a set of points of ring directly around the selected point. I am looking for a solution to get _all_ the points, from a certain point and the move in a ring towerds the outside of a

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-18 Thread Jiri Heitlager | dadata.org
I'll take it ;) thanks for everybody's help. Jiri Merrill, Jason wrote: That is a nice solution, but it leaves me with the problem that starting from one point (3,2) it only produces a set of points of ring directly around the selected point. I am looking for a solution to get _all_ the

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-17 Thread Jiri Heitlager | dadata.org
Please I really need help on this on, I am cracking my head over it. Bresenham algo is also not the way to go, because it is for circle's and to complex! I can only get one ring, arggg If I go one ring further then it results in many double values, calculate allready when doing the

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-17 Thread Joshua Sera
The easy way to do this is like so. So you have a square at x,y, and you want to get all the squares n squares away. Get squares x+n, y x-n, y x+n, y+n x-n, y+n x+n, y-n x-n, y-n x, y+n x, y-n I suspect you want to do this for your version of that whale-ey thing though, so what

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-17 Thread Jiri Heitlager | dadata.org
Thxn Joshua and others, I have to look into that. In the mean time I came up with the following code. This takes in a vector and then calculates a 'ring' from that position. With this, I can scale up the 'radius' and get recursively get all the rings from a point from in to outer ring. My

[Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
Hello list, I have the following grid and would like to find the neighbouring positions of a certain point, going in a radius from in to out, covering all the positions. [0,0] [1,0] [2,0] [3,0] [4,0] [0,1] [1,1] [2,1] [3,1] [4,1] [0,2] [1,2] [2,2] [3,2] [4,2] [0,3] [1,3] [2,3] [3,3] [4,3]

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Ron Wheeler
It depends how you define the rings. It is by distance or by connectedness? Is 0,0 in the second ring with 1.0 and 0,1? What is the purpose of knowing this? Ron Jiri Heitlager | dadata.org wrote: Hello list, I have the following grid and would like to find the neighbouring positions of a

RE: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Merrill, Jason
PROTECTED] On Behalf Of Jiri Heitlager | dadata.org Sent: Saturday, June 16, 2007 8:16 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Grid / Math - getting neighbouring positions Hello list, I have the following grid and would like to find the neighbouring positions of a certain point

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
The ring is defined by distance not by connectedness. It is used for the following. A big image will be split into tiles of 100x100 pixels, that are loaded from a server. The total image made of these tiles are loaded in a movieclip so that the image is rebuilded. The image is masked by a

Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jiri Heitlager | dadata.org Sent: Saturday, June 16, 2007 8:16 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Grid / Math - getting neighbouring positions Hello list, I have the following grid and would like to find