fix preious particle path

This commit is contained in:
lapin 2020-10-09 17:31:40 +02:00
parent a747c84af8
commit afd9ae51f8
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ public class Attractor
Attractor(){
pos = new PVector(0, 0, 0);
is_active = false;
weight = 30;
weight = 200;
circle_radius = 20;
col = getColInt(0, 0, 50);

View File

@ -16,7 +16,7 @@ LeapMotion leap;
LaserOut laser_frame;
int hand_id;
Attractor[] attractors = new Attractor[10];
Particle[] particles = new Particle[1];
Particle[] particles = new Particle[10];
PVector min_pos;
PVector max_pos;
@ -39,7 +39,7 @@ void setup() {
attractors[i] = new Attractor();
}
for (int i = 0; i < particles.length; i++){
particles[i] = new Particle(200); // number of previous position drawn
particles[i] = new Particle(30); // number of previous position drawn
}
}

View File

@ -78,7 +78,7 @@ class Particle{
Point[] previous_pos = new Point[circular_pos.length];
for (int i = 0; i < circular_pos.length; i++){
id = (circular_id - i + circular_pos.length) % circular_pos.length;
previous_pos[i] = new Point(int(circular_pos[i].x), int(circular_pos[id].y), getColInt(0, 255, 0));
previous_pos[i] = new Point(int(circular_pos[id].x), int(circular_pos[id].y), getColInt(0, 255, 0));
}
//println("plop");
laser_frame.add_line(previous_pos);