-
Notifications
You must be signed in to change notification settings - Fork 0
/
dots-random-lines.html
62 lines (46 loc) · 1.12 KB
/
dots-random-lines.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/addons/p5.dom.min.js"></script>
<script>
function setup() {
createCanvas(windowWidth, windowHeight);
background(40);
frameRate(5);
}
function draw() {
let startime = millis();
let x = random(0, windowWidth);
let y = random(0, windowHeight);
let z = random(0,50);
let u = random(0, windowWidth);
let v = random(0, windowHeight);
let q = random(0, windowWidth);
let a = random(0, windowHeight);
console.log(startime);
let r = random(0,70);
let g =random(100,200);
let b= random(200,255);
//background(0);
stroke(20,255,255);
strokeWeight(random(0.1,0.2));
line(x,y,z,u);
line(q,a,v,x);
noStroke();
fill(r,g,b);
circle(x,y,z,z);
fill(255);
noStroke();
circle(u,v,1,1);
fill(255,255,255);
noStroke();
circle(q,a,5,5);
}
</script>
<style> body {padding: 0; margin: 0; position:fixed;} </style>
<title>My first 3d animation</title>
</head>
<body>
</body>
</html>