Filling a rectangular matrix area

alessandro.saccoia's icon

Hello,
I am generating 2 random coordinates (a,b) in a 20 x 15 matrix, and
trying to fill with a random grey color the portion of the matrix
whose coordinates are
x > a and y < b
I don't know why when i do the comparison I always get a stripe of the
random color in the first column of the matrix. Can you suggest how to
solve this? I think using uzi to fill a list to be crunched by
jit.fill is not a great solution, so if you understand what I am
trying to do, that is really simple, and have a better solution please
give me an advice. Thanks a lot,
Ale

My patch:

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

Andrew Benson's icon

For this sort of task, I recommend using the jit.expr object or the
exprfill message to jit.matrix. See the jit.expr help file and examples
for more info.

--
Andrew B.

Wesley Smith's icon

Hi,
If you're trying to fill a rectangular area of a matrix, you can use
jit.lcd to do it. If you're just wanting to do it on the final
output, you can use opengl drawing commands to do it.

best,
wes

alessandro.saccoia's icon

thanks guys, I was stuck on that doing complicated stuff I knew there
would have been an easier way for such a simple task.
ale