/
index.html
44 lines (40 loc) · 1.69 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
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Checkpoints</title>
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<script src="../../dist/aframe-extras.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-mixin id="checkpoint"></a-mixin>
<a-mixin id="checkpoint-hovered" color="#6CEEB5"></a-mixin>
</a-assets>
<!-- Player -->
<a-entity id="rig" movement-controls="controls: checkpoint" checkpoint-controls="mode: animate">
<a-entity camera
position="0 1.6 0"
look-controls="pointerLockEnabled: true">
<a-entity cursor
raycaster="objects:[checkpoint]"
position="0 0 -1"
geometry="primitive: ring; radiusInner: 0.02; radiusOuter: 0.03;"
material="color: #CCC; shader: flat;"></a-entity>
</a-entity>
</a-entity>
<!-- Terrain -->
<a-grid></a-grid>
<!-- Checkpoints -->
<a-entity position="1 0 1">
<a-cylinder checkpoint radius="1" height="0.1" position="0 0 -5.2" color="#39BB82"></a-cylinder>
<a-cylinder checkpoint radius="1" height="0.1" position="3 0 0" color="#39BB82"></a-cylinder>
<a-cylinder checkpoint radius="1" height="0.1" position="-3 0 0" color="#39BB82"></a-cylinder>
</a-entity>
<!-- Lighting -->
<a-light type="ambient" color="#fff"></a-light>
</a-scene>
</body>
</html>