-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
98 lines (79 loc) · 2.97 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!doctype html>
<html lang="en">
<head>
<title>zeeBar Home</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<body>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r56/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r56/examples/js/controls/TrackballControls.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r56/examples/js/libs/stats.min.js"></script>
<script src='https://cdn.jsdelivr.net/gh/mrdoob/three.js@r56/examples/fonts/helvetiker_bold.typeface.js'></script>
<!--
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r52/examples/js/Detector.js"></script>
<!--
<script src='http://mrdoob.github.com/three.js/build/three.min.js'></script>
<script src="http://mrdoob.github.com/three.js/examples/js/controls/TrackballControls.js"></script>
<script src='http://mrdoob.github.com/three.js/examples/js/libs/stats.min.js'></script>
-->
<!--
<script src='../three.js/build/three.min.js'></script>
<script src="../three.js/examples/js/controls/TrackballControls.js"></script>
<script src='../three.js/examples/js/libs/stats.min.js'></script>
<script src='../three.js/examples/fonts/helvetiker_bold.typeface.js'></script>
-->
<script src='zeebar/assets.js'></script>
<script src='zeebar/device-events.js'></script>
<script src='heads-up-zeebar.js'></script>
<script src='file-manifest-root.js'></script>
<script>
var renderer, controls, scene, camera, light, projector,
geometry, material, mesh,
clock = new THREE.Clock();
init();
animate();
function init() {
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.shadowMapEnabled = true;
renderer.shadowMapSoft = true;
document.body.appendChild( renderer.domElement );
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( 20, 20, -20);
controls = new THREE.TrackballControls( camera);
controls.noZoom = true;
scene.add( new THREE.AmbientLight( 0x505050 ) );
light = new THREE.SpotLight( 0xffffff, 1.5 );
light.position.set( -50, 50, -50 );
light.castShadow = true;
light.shadowCameraNear = 1;
light.shadowCameraFar = camera.far;
light.shadowCameraFov = 50;
light.shadowBias = -0.00005;
light.shadowDarkness = 0.5;
light.shadowMapWidth = 2048;
light.shadowMapHeight = 2048;
scene.add( light );
projector = new THREE.Projector();
stats = new Stats();
document.body.appendChild(stats.domElement);
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
stats.domElement.style.right = '20px';
stats.domElement.style.zIndex = 100;
}
function animate() {
requestAnimationFrame( animate );
render();
stats.update();
}
function render() {
controls.update();
updateHeadsUp(); // see device-events.js
renderer.render( scene, camera );
}
</script>
</body>
</html>