Hi, we have to research about particles and I found one sketch that I liked, but noticed its on P5.js. I’ve trying to open remake this sketch in processing but i’m having a really hard time doing it (3 and half hours until now)
My code is this
Tadpoles[] tads = new Tadpoles[40];
void setup() {
size(450, 450);
for (int i = 0; i < tads.length; i++) {
tads[i] = new Tadpoles();
};
}
void draw() {
for (int i = 0; i < 40; i += 1) {
tads[i].update();
tads[i].display();
}
}
class Tadpoles {
float i, ii, t = 0, ts = 0;
float x=0,y=0;
Prev[] p = new Prev[10];
Tadpoles(){
t = random(0,10000);
ts = random(0,100);
}
void update () {
PVector pos = (
noise(t + ts) * width,
noise(t + tts + 100) * height
);
t = t + 0.005;
}
void display () {
fill(0);
ellipse(pos.x, pos.y, 4, 4);
for (ii = 9; ii > 0; ii -= 1) {
this.prev[ii].x = this.prev[ii - 1].x;
this.prev[ii].y = this.prev[ii - 1].y;
fill(20, 50, 0, 10);
ellipse(this.prev[ii].x, this.prev[ii].y, 14-ii, 14-ii);
}
this.prev[0].x = this.pos.x;
this.prev[0].y = this.pos.y;
}
}
The class Tadpoles is not finished, but i wanted to ask because i just keep and keep getting errors, so I have no idea if i’m actually making progress
Is there a concrete way to convert the syntax of p5.js to processing ? (it’s javascript to java, right) ?