making a grid ...

andrea.schiller362's icon

Hi,
- I would like to make a grid between 1000x values and 1000 y values with a
resolution of 50, so that each field of the grid is 50 values. If the x and
y values from i.e. a wii are inside the very first field x value 0-50 and y
value 0-50, then write "a", if the second field x value is 50-100 and y
value is 0-50 then write "b" aso.

How do I do that efficiently in max, without using a ton of
if-sentence-objects? Could anyone give me a good example?

Best,
Andrea

jasch's icon

effectively you're dividing the 1000 value range into 20 parts.
the easiest way would be to divide x and y by 50 then multiply y by 20
to get the row step and add the two values together to get a unique
consecutive index for each grid-square. fill a coll with the desired
results at each square index, query that and you're done.

hth

/*j

> - I would like to make a grid between 1000x values and 1000 y values
> with a resolution of 50, so that each field of the grid is 50
> values. If the x and y values from i.e. a wii are inside the very
> first field x value 0-50 and y value 0-50, then write "a", if the
> second field x value is 50-100 and y value is 0-50 then write "b" aso.

Max Patch
Copy patch and select New From Clipboard in Max.