-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
45 lines (36 loc) · 1.04 KB
/
Copy pathscript.js
File metadata and controls
45 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
arrayPosizioniX = [];
arrayPosizioniY = [];
arrayPosizioniZ = [];
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
normalMaterial();
console.log('Valore di X:' + Math.sqrt(Math.pow(300, 2)-(Math.pow((100 - 0), 2))));
console.log('Valore di Y:' + -Math.sqrt(Math.pow(300, 2)-(Math.pow((100 - 0), 2))));
for(let i = 0; i < 100; i++) {
arrayPosizioniX.push(random(400));
arrayPosizioniY.push(random(400));
arrayPosizioniZ.push(random(200));
}
}
var i = 0;
function draw() {
// camera(200, 200, 300, 0, 0, 0);
background('black');
orbitControl();
noFill();
stroke(100, 100, 240);
push();
//rotate(i);
//i += 0.005;
ellipse(0, 0, 600, 600);
pop();
push();
rotate(i);
for(let i = 0; i < arrayPosizioniX.length; i++) {
push();
translate(Math.sqrt(Math.pow(300, 2)-(Math.pow((100 - 0), 2))), -Math.sqrt(Math.pow(300, 2)-(Math.pow((100 - 0), 2))), 0);
box(30, 50);
pop();
}
pop();
}