xxxxxxxxxx
55
var fps;
var ns = 0.003;//Noise Size
var nsp = 0.005;//Noise Speed
var t = 0;
var d;
var dx4;
function setup() {
//createCanvas(windowWidth, windowHeight);
createCanvas(750, 750);
fps = 30;
frameRate(fps);
colorMode(HSB, 360,100 ,100);
d=pixelDensity();
dx4=d*4;
dx8=d*8;
print(d);
}
function draw() {
background(268,72,65);
stroke(0,0,100);
strokeWeight(4);
for(var x=0;x<width;x+=dx4){
point(x,height/2 + (noise(x * ns,t)-0.5)*height*2/3);
}
strokeWeight(6);
for(var x=0;x<width;x+=dx8){
for(var y=0;y<height;y+=dx8){
strokeWeight(noise(x * ns,y * ns,t)*dx8-2);
point(x,y);
}
}
/*
for(var x=0;x<width;x+=dx4){
for(var y=0;y<height;y+=dx4){
var n = noise(x * ns,y * ns,t);
if(n<0.5){
point(x,y);
}
}
}
*/
t+=nsp;
}
function touchStarted(){
}