-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (49 loc) · 925 Bytes
/
script.js
File metadata and controls
52 lines (49 loc) · 925 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
let illo = new Zdog.Illustration({
// set canvas with selector
element: '.zdog-canvas',
zoom:1.5,
rotate: { x:-0.4,y:0.4 },
});
function animate() {
// rotate illo each frame
illo.rotate.y -= 0.03;
illo.updateRenderGraph();
// animate next frame
requestAnimationFrame( animate );
}
// start animation
animate();
// add circle
new Zdog.Cylinder({
addTo: illo,
diameter: 80,
length: 10,
stroke:0,
color: '#555',
frontFace: '#888',
backface: '#555',
});
var faceGroup = new Zdog.Group({
addTo: illo,
translate: { z: 15 },
});
new Zdog.Shape({
addTo: faceGroup,
path: [
{ y: -25 }, // start at 1st point
{ y: 0 }, // line to 2nd point
],
stroke: 10,
color: '#000',
});
new Zdog.Shape({
addTo: faceGroup,
path: [
{ x: 25 }, // start at 1st point
{ x: 0 }, // line to 2nd point
],
stroke: 10,
color: '#000',
});
// update & render
illo.updateRenderGraph();