awacke1's picture
Update index.html
c57b743
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A-Frame 3D Map Flight</title>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>
<a-scene>
<!-- Load the map surface as a dataset -->
<a-plane id="map-surface"
height="50"
width="50"
position="0 0 -50"
material="shader:flat;color:#333;src:#map-data"></a-plane>
<!-- Define the map data as a text asset -->
<a-assets>
<a-asset-item id="map-data" src="#map-data-text"></a-asset-item>
<a-text id="map-data-text" value='[
{"x": -10, "y": 0, "z": -10},
{"x": 10, "y": 0, "z": -10},
{"x": 10, "y": 0, "z": 10},
{"x": -10, "y": 0, "z": 10}
]'></a-text>
</a-assets>
<!-- Set the camera to the player's viewpoint and add a flying script -->
<a-entity id="camera"
position="0 1.6 0"
camera
wasd-controls
fly></a-entity>
</a-scene>
</body>
</html>