«Neuromaton» (A Generative Algorithm) from Armando Rodriguez on Vimeo.
«Neuramaton» is a continuation of my «Wool Thread» experiment, in that post I published the code wich shows a simple system of linked particles in a thread. Every particle has it’s own repultion or attraction force and a group of these particles it’s called thread. In «Neuromaton» a system of threads interacts creating interesting patterns and geometries. I’ll post the «Wool Thread» code again in this post. Feel free to «sample» this code.
Music and Algorithm by José Armando Rodríguez
Jose Armando Rodriguez, Mexico City 2016
Software used: Processing (Punktiert library)and After Effects
This work was inspired on Frei Otto’s research and Daniel Köhler’s implementations.
import punktiert.math.Vec;
import punktiert.physics.*;
// world object
VPhysics physics;
ArrayList<VParticleString> strings = new ArrayList<VParticleString>();
int numStrings=150;
int radio = 450;
public void setup() {
smooth();
size(1200, 750,P3D);
// create world object with bouncing behavior
physics = new VPhysics();
physics.setfriction(.0001f);
for (int i=0; i<numStrings; i++) {
float anguloA = random(0, 2*PI);
float anguloB = random(-PI/2, PI/2);
VParticle particleA = new VParticle((cos(anguloB)*cos(anguloA)*radio), (cos(anguloB)*sin(anguloA)*radio), radio*sin(anguloB));
// particleA.isLocked();
VParticle particleB = new VParticle(((-cos(anguloB)*cos(anguloA))*radio), (-cos(anguloB)*sin(anguloA)*radio), -radio*sin(anguloB));
particleB.isLocked();
//create a ParticleString: input: VPhysics, particleA, particleB, resolution, strength
strings.add(new VParticleString(physics, particleB, particleA, .1f, .02f));
physics.addGroup(strings.get(i));
}
for(int i=0; i<numStrings; i++){
float anguloA1 = random(0,2*PI);
float anguloA2 = random(0,2*PI);
float anguloB1 = random(0,2*PI);
float anguloB2 = random(0,2*PI);
float radioR = random(radio/2,radio);
VParticle particleA = new VParticle((cos(anguloB1)*cos(anguloA1)*radioR), (cos(anguloB1)*sin(anguloA1)*radioR), radioR*sin(anguloB1));
//particleA.isLocked();
VParticle particleB = new VParticle(((-cos(anguloB2)*cos(anguloA2))*radioR), (-cos(anguloB2)*sin(anguloA2)*radioR), -radioR*sin(anguloB2));
//particleB.isLocked();
//create a ParticleString: input: VPhysics, particleA, particleB, resolution, strength
strings.add(new VParticleString(physics, particleB, particleA, .1f, .02f));
physics.addGroup(strings.get(i));
}
//BAttractionLocal(float radius, float strength)
physics.addBehavior(new BAttractionLocal(30, 180));
physics.addBehavior(new BCollision());
physics.addBehavior(new BCohesion(30, 1.5f, .9f));
}
public void draw() {
//rectMode(CORNER);
//fill(255,30);
//noStroke();
//rect(0,0,width,height);
background(255);
float sp = 0.002 * frameCount;
camera( 500 *cos(sp), 500 *sin(sp), 500, 0, 0, 0, 0, 0, -1);
stroke(0);
strokeWeight(1);
physics.update();
for (VSpring s : physics.springs) {
line(s.a.x, s.a.y,s.a.z, s.b.x, s.b.y,s.b.z);
}
saveFrame(“screen-####.jpg”);
}
Un comentario en ““Neuromaton” (A Generative Algorithm)”