Filling a rectangular matrix area


    Apr 11 2006 | 1:21 pm
    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 v2;

    • Apr 11 2006 | 3:01 pm
      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.
    • Apr 11 2006 | 3:04 pm
      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
    • Apr 11 2006 | 6:40 pm
      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