save current progress
This commit is contained in:
parent
806265f4c3
commit
b08c78257b
4 changed files with 92 additions and 0 deletions
32
public/scripts/input-output.js
Normal file
32
public/scripts/input-output.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
function setup() {
|
||||
let canvas = createCanvas(710, 400, WEBGL);
|
||||
canvas.parent('input-output');
|
||||
angleMode(DEGREES);
|
||||
strokeWeight(5);
|
||||
noFill();
|
||||
stroke(32, 8, 64);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
background(250, 180, 200);
|
||||
|
||||
// Call every frame to adjust camera based on mouse/touch
|
||||
orbitControl();
|
||||
|
||||
// Rotate rings in a half circle to create a sphere of cubes
|
||||
for (let zAngle = 0; zAngle < 180; zAngle += 30) {
|
||||
// Rotate cubes in a full circle to create a ring of cubes
|
||||
for (let xAngle = 0; xAngle < 360; xAngle += 30) {
|
||||
push();
|
||||
|
||||
// Rotate from center of sphere
|
||||
rotateZ(zAngle);
|
||||
rotateX(xAngle);
|
||||
|
||||
// Then translate down 400 units
|
||||
translate(0, 400, 0);
|
||||
box();
|
||||
pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue