Possibilità grafiche (oltre l'ellisse)
// height=500
function setup() {
createCanvas(windowWidth, 500, WEBGL);
setAttributes('antialias',true);
cursor('grab');
}
function draw() {
background(245);
orbitControl(2,2);
//rotateY(frameCount * 0.01);
normalMaterial();
// noStroke();
// specularMaterial(0,0,255);
// ambientMaterial(105, 195, 255);
// let locX = mouseX - width / 2;
// let locY = mouseY - height / 2;
// pointLight(250, 250, 0, locX, locY, 50);
for (let j = 0; j < 5; j++) {
push();
for (let i = 0; i < 80; i++) {
translate(
sin(frameCount * 0.0005 + j) * 100,
sin(frameCount * 0.0005 + j) * 100,
i * 0.1
);
rotateZ(frameCount * 0.001);
push();
// sphere(8, 6, 4);
sphere(8, 18, 12);
pop();
}
pop();
}
}
function mousePressed() {
cursor('grabbing');
}
function mouseReleased() {
cursor('grab');
}
function windowResized() {
resizeCanvas(windowWidth, 500);
}
Grafica 3D, visualizzazione dati, visualizzazione musica, grafica generativa e interattiva, ecc.
La composizione può essere ruotata mentre si evolve tenendo premuto il pulsante del mouse e spostando il cursore.