-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (68 loc) · 1.64 KB
/
index.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
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>HTML 5 Boilerplate</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<canvas height="600" id="canvas" style="border: 1px grey solid" width="600" js-canvas>
</canvas>
<script src="scripts/CanvasRenderer.js"></script>
<script>
window.renderer = new CanvasRenderer({
$canvas: document.querySelector('[js-canvas]'),
viewport: {
distance: 1,
sizeX: 1,
sizeY: 1
},
spheres: [
{
radius: 1,
center: [0, -1, 3],
color: [255, 0, 125],
specular: 500
},
{
radius: 1,
center: [2, 0, 4],
color: [240, 240, 240],
specular: 500
},
{
radius: 1,
center: [-2, 0, 4],
color: [0, 255, 0],
specular: 10
},
{
color: [255, 255, 0],
center: [0, -5001, 0],
radius: 5000,
specular: 1000
}
],
lights: [
{
type: 'ambient',
intensity: 0.2
},
{
type: 'point',
intensity: 0.6,
pos: [2, 1, 0]
},
{
type: 'directional',
intensity: 0.2,
pos: [1, 4, 4]
}
]
});
window.renderer.init().render();
</script>
</body>
</html>