Flocking using GEN

Jul 19, 2013 at 8:48am

Flocking using GEN

Hello everybody,

I was wandering if it is possible to write a flocking algorithm in Gen?
I know that there are the boid externals but I want to write one in gen making it more flexible.

Greetz Eric

#256483
Jul 19, 2013 at 9:54am

Not that I know of. You’d need to use codebox and a for loop over the input matrix to do the neighbor calculations. Using a 1D matrix would make things simpler.

#256494
Jul 19, 2013 at 12:44pm

Thanks, yes I was also thinking of a 1D matrix, I once built the algorithm in processing and there I also used a 1D array.
But I’m new to gen so I was wandering if it could be done.
A 1D matrix is only possible in jit.gen right? Because I would like to run it on the GPU.

#256517
Jul 22, 2013 at 12:19pm

jit.gl.pix runs on the GPU. jit.gen and jit.pix on the CPU. Here’s a jit.gen version:

<code>

– Pasted Max Patch, click to expand. –

</code>

#256794
Jul 23, 2013 at 2:57am

wow, super thanks! This helps me a lot.

#256862

You must be logged in to reply to this topic.