Forums > Jitter

How to fill a matrix with a checkerboard pattern?

Mar 06 2014 | 9:13 am

Does anyone know a nice elegant way to fill a matrix with a checkerboard pattern?

Let’s say for example that the two colours will be cyan and magenta. Also, each square will be just one cell of the matrix.

I could use uzi and counter to loop through all the odd cells and then all the even cells, but I’m guessing there’s a more efficient way.

Mar 06 2014 | 11:47 am

jit.bfg, check the help, third tab "checker"
Would that do ?

Mar 06 2014 | 3:04 pm

Yes, I did see that shortly after I posted! I will experiment… I need to find the right settings so that the pattern matches up perfectly to the resolution of the matrix – one square per cell/pixel.

Mar 06 2014 | 3:09 pm

You could also investigate using [jit.expr] with the cell arguments

Mar 07 2014 | 8:44 am

I’d say, just do it once with uzi and you’re done with it in a few microseconds never to worry about it again.

-- Pasted Max Patch, click to expand. --


Mar 07 2014 | 4:40 pm

A simple and efficient technique would be to use jit.gen along with [cell] [%] and [<] objects.

Mar 07 2014 | 8:42 pm

Yes, gen is great for cellwise stuff.

-- Pasted Max Patch, click to expand. --


Viewing 7 posts - 1 through 7 (of 7 total)

Forums > Jitter