Update index.html
Browse files- index.html +34 -10
index.html
CHANGED
@@ -1,12 +1,36 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>A-Frame 3D Map Flight</title>
|
6 |
+
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<a-scene>
|
10 |
+
<!-- Load the map surface as a dataset -->
|
11 |
+
<a-plane id="map-surface"
|
12 |
+
height="50"
|
13 |
+
width="50"
|
14 |
+
position="0 0 -50"
|
15 |
+
material="shader:flat;color:#333;src:#map-data"></a-plane>
|
16 |
|
17 |
+
<!-- Define the map data as a text asset -->
|
18 |
+
<a-assets>
|
19 |
+
<a-asset-item id="map-data" src="#map-data-text"></a-asset-item>
|
20 |
+
<a-text id="map-data-text" value='[
|
21 |
+
{"x": -10, "y": 0, "z": -10},
|
22 |
+
{"x": 10, "y": 0, "z": -10},
|
23 |
+
{"x": 10, "y": 0, "z": 10},
|
24 |
+
{"x": -10, "y": 0, "z": 10}
|
25 |
+
]'></a-text>
|
26 |
+
</a-assets>
|
27 |
|
28 |
+
<!-- Set the camera to the player's viewpoint and add a flying script -->
|
29 |
+
<a-entity id="camera"
|
30 |
+
position="0 1.6 0"
|
31 |
+
camera
|
32 |
+
wasd-controls
|
33 |
+
fly></a-entity>
|
34 |
+
</a-scene>
|
35 |
+
</body>
|
36 |
+
</html>
|