Esempio n. 1
0
 public void draw() {
   background(0);
   environment.run();
   environment.update(false);
   pheromones.fade(0.99f);
   pheromones.render(2, 50, 1, this);
   // canvas.drawTrails(environment.pop, 1, 255);
 }
Esempio n. 2
0
  void flow(VoxelGrid volume) {

    // get the value of the current voxel
    float v = volume.getValue(this);

    // check neighbouring voxels for difference
    Vec3D from = volume.repelFromValue(this, 0, 1, 0.1f).limit(0.1f);
    if (!from.isZeroVector()) {
      lastSub += 1;
    } else {
      lastSub = 0;
    }
    addForce(from);
  }
Esempio n. 3
0
 public void keyPressed() {
   if (key == 's') {
     // NOTE - save this and open in amira- use data type byte and enter the size of the voxels
     // (100,100,100)
     pheromones.save("grid.raw");
   }
   if (key == 'a') {
     addParticles();
   }
 }