Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created February 10, 2016 20:12
Show Gist options
  • Save jacobjoaquin/1a75ad68e76d9e3820d3 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/1a75ad68e76d9e3820d3 to your computer and use it in GitHub Desktop.
Perlin Rainbow Tube for p5js.
var nx = 0,
ny = 1000,
nz = 2000,
nInc = 0.008;
function setup() {
createCanvas(500, 500);
colorMode(HSB);
}
function draw() {
fill(frameCount % 360, 255, 255);
var x = noise(nx) * width;
var y = noise(ny) * height;
var z = map(noise(nz), 0, 1, 0, 75);
ellipse(x, y, z, z);
nx += nInc;
ny += nInc;
nz += nInc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment