Skip to content

Instantly share code, notes, and snippets.

@caioluders
Created March 31, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caioluders/68c72bf8cbbac339fee185eef63a0b43 to your computer and use it in GitHub Desktop.
Save caioluders/68c72bf8cbbac339fee185eef63a0b43 to your computer and use it in GitHub Desktop.
float a , b , c , t , x , y , z ;
void setup() {
size(800,800) ;
smooth();
frameRate(300) ;
noFill() ;
fill(0) ;
background(0) ;
a = random(0.0,15.0) ;
b = random(0,30.0) ;
c = random(0,10) / random(0,5.0) ;
t = 0.005 ;
x = .1 ;
y = 0 ;
z = 0 ;
}
void draw() {
float ox, oy, oz , dx , dy , dz , nx , ny , nz;
ox = x;
oy = y;
oz = z;
dx = a*(y - x);
dy = b*x - y - x*z;
dz = x*y - c*z;
t = noise(dx,dy,dz)/10 ;
x += t*dx;
y += t*dy;
z += t*dz;
float tx1 = map(x, -30, 30, 0, width);
float ty1 = map(z, 0, 60, height, 0);
float tx2 = map(ox, -30, 30, 0, width);
float ty2 = map(oz, 0, 60, height, 0);
stroke(255);
line(tx1, ty1, tx2, ty2);
}
void keyReleased()
{
if (key==' ') setup();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment