Spaces:
Running
Running
Update index.html
Browse files- index.html +28 -16
index.html
CHANGED
@@ -1,19 +1,31 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<title>A-Frame GLB Loader Demo</title>
|
6 |
+
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/aframe-animation-component/dist/aframe-animation-component.min.js"></script>
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
<a-scene>
|
11 |
+
<!-- Load the first GLB file -->
|
12 |
+
<a-gltf-model id="model1" src="model1.glb" position="-2 0 -5" animation-mixer></a-gltf-model>
|
13 |
+
|
14 |
+
<!-- Load the second GLB file -->
|
15 |
+
<a-gltf-model id="model2" src="model2.glb" position="2 0 -5" animation-mixer></a-gltf-model>
|
16 |
+
|
17 |
+
<!-- Add a ground plane for the models to stand on -->
|
18 |
+
<a-plane position="0 -1 -5" rotation="-90 0 0" width="10" height="10" color="#7BC8A4"></a-plane>
|
19 |
+
|
20 |
+
<!-- Create an interface for moving the models around -->
|
21 |
+
<a-entity id="controller" laser-controls="hand: right" raycaster="objects: .movable">
|
22 |
+
<a-entity id="model1-handle" class="movable" position="-2 0 -5" rotation="0 45 0" scale="0.5 0.5 0.5">
|
23 |
+
<a-entity gltf-model="#model1" animation-mixer></a-entity>
|
24 |
+
</a-entity>
|
25 |
+
<a-entity id="model2-handle" class="movable" position="2 0 -5" rotation="0 -45 0" scale="0.5 0.5 0.5">
|
26 |
+
<a-entity gltf-model="#model2" animation-mixer></a-entity>
|
27 |
+
</a-entity>
|
28 |
+
</a-entity>
|
29 |
+
</a-scene>
|
30 |
+
</body>
|
31 |
</html>
|