Help with a Jit.Gen question?

jeremystewart87's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hey everyone, I'm working on a patch for playing with cellular automata rules. I'm using a few Jit.Gen objects to do it:

My question is, when you are "painting" in this patch, everything is flowing to the bottom right, did I mess up the patch somewhere to cause that? Or is there a way to work around that (ie: change the direction, or have it not "flow" in any particular direction, but just follow the assigned rules)?

Thanks,

vichug's icon

hey, i can't really understand the details of the logic, but one things jumps to mind is that if somewhere in your rules there is a preference for incrementation of coordinates of active(white) cell then it's normal, because the 0,0 point is at the lefttop of the screen, and the 400,400 at the bottom right - hence, by simple increment of coordinates, points will "flow" towards bottom right.

jeremystewart87's icon

I thought it might be something like that, that makes sense. Any ideas on how to prevent it from happening?

Wesley Smith's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It was flowing to the bottom right due to how you were sampling the matrix. Sample coordinates range from [0, 1]. You were sampling from [0, cell/dim] and cell/dim is equal to 1-1/dim, so it doesn't quite cover the same range. As a result, the image was being scaled slightly on each iteration, causing the flow. I've changed the patch a bit and it's now stable.