float x = 0.10;
float y = 0.0;
float z = 0.0;
float a = 10;
float b = 28;
float c = 8.0/3.0;
ArrayList<PVector> points = new ArrayList<PVector>();
void setup() {
size(800, 600);
colorMode(HSB);
}
void draw() {
background(0);
float dt = 0.01;
float dx = (a * (y - x)) * dt;
float dy = (x * (b - z) - y) * dt;
float dz = (x * y - c * z)*dt;
x = x + dx;
y = y + dy;
z = z + dz;
points.add(new PVector(x, y, z));
scale(5);
stroke(255);
noFill();
beginShape();
float hu = 0;
for (PVector v : points) {
stroke(hu, 255, 255);
vertex(v.x-1, v.y-1);
hu += 0.1;
if (hu > 255) {
hu = 0;
}
}
endShape();
//println(x, y, z);
}
Hi, I am new to processing and I was making the lorenz attractor similar to the video of Daniel Shiffman on YouTube.
It was made in 3d but I want to create it into 2D because I am working on another project.
I found that just getting rid of the peasycam and P3D option is ok but when I ran the program it was showing the program on the top left on the screen what exactly should I change.
If you want to know why I am doing this in 2D because I want to do some tests for the future because I want to get the simulation in the console using the Rust Programming language.