Forums > Gen

Help with a Jit.Gen question?

March 4, 2014 | 10:08 am

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:

<code>

– Pasted Max Patch, click to expand. –

</code>

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,


March 5, 2014 | 8:01 am

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.


March 5, 2014 | 8:05 am

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


March 5, 2014 | 12:26 pm

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.

<code>

– Pasted Max Patch, click to expand. –

</code>


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