-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
67 lines (56 loc) · 1009 Bytes
/
demo.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
63
64
65
66
67
<html>
<body>
<canvas width="300" height="300"></canvas>
<script src="gl-matrix.js"></script>
<script src="draw-scene.js"></script>
<script>
var shapes = [
{
name: "triangle",
position: [-1.5, 0.0, -7.0],
verticies: [
0.0, 1.0, 0.0,
-1.0, -1.0, 0.0,
1.0, -1.0, 0.0
],
pointCount: 3,
colors: [
1.0, 0.4, 0.6, 1.0,
0.9, 0.4, 0.7, 1.0,
0.8, 0.4, 0.9, 1.0
]
},
{
name: "square",
position: [1.5, 0.0, -7.0],
verticies: [
1.0, 1.0, 0.0,
-1.0, 1.0, 0.0,
1.0, -1.0, 0.0,
-1.0, -1.0, 0.0
],
pointCount: 4,
colors: [
1.0, 0.8, 0.2, 1.0,
0.9, 0.7, 0.4 , 1.0,
0.8, 0.7, 0.6, 1.0,
0.7, 0.6, 0.8, 1.0
]
}
]
var camera = {
fovy: 45,
near: 0.1,
far: 100.0,
pitch: 0.0,
yaw: 0.0,
xPos: 0.0,
yPos: 0.4,
zPos: 0.0
}
drawScene(shapes, camera)
// If you want to redraw without rebuffering:
drawScene.again(camera)
</script>
</body>
</html>