xxxxxxxxxx
73
var nombreCoupe = 30;
var yRandom = [] ; var yRandomNoise = [] ;
var noiseMark = 0;
var noiseMarkModifier = 0.1;
var partie_taille;
var ajout = 500;
var millis_a_atteindre;
function setup() {
createCanvas(1600, 900);
print("helloi");
partie_taille = width/(nombreCoupe-1);
background(255,50,50);
millis_a_atteindre= millis() +ajout;
calculer_lignes();
}
function draw()
{strokeWeight(8);
//
//dessiner_lignes();
if (millis() > millis_a_atteindre)
{
background(255,50,50);
calculer_lignes();
millis_a_atteindre = millis()+ajout;
for (var j = 1; j<yRandom.length; j++)
{
line(partie_taille * (j-1), yRandom[j-1],partie_taille * j, yRandom[j]);
line(partie_taille * (j-1), yRandomNoise[j-1],partie_taille * j, yRandomNoise[j]);
}
}
else{}
}
function calculer_lignes()
{
for (var i = 0; i<nombreCoupe; i++)
{ yRandom[i] = random(0,1);
yRandomNoise[i] = noise(noiseMark);
noiseMark += noiseMarkModifier;
yRandom[i] = map(yRandom[i],0,1,0,height/2);
yRandomNoise[i] = map(yRandomNoise[i],0,1,height/2,height);
}
}