-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsketch.js
More file actions
29 lines (27 loc) · 698 Bytes
/
Copy pathsketch.js
File metadata and controls
29 lines (27 loc) · 698 Bytes
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
let canvas
let rot = []
const count = 5
function setup () {
canvas = createCanvas(windowWidth * 2, windowHeight * 2, WEBGL);
noFill()
stroke("#ccffff66")
strokeWeight(1)
rectMode(CENTER)
canvas.position(-windowWidth / 2, -windowHeight / 2)
canvas.style('z-index', '-1')
for (let i = 0; i < count; i++) {
let v = createVector(random(PI * 2), random(PI * 2), random(PI * 2))
rot.push(v)
}
}
function draw () {
background(0);
rot.forEach(d => {
push()
rotateX(d.x + millis() / 100000)
rotateY(d.y + millis() / 200000)
rotateZ(d.z + millis() / 500000)
rect(0, 0, width, height)
pop()
})
}