forked from jgbarah/aframe-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrab-ar-2.html
47 lines (44 loc) · 1.71 KB
/
grab-ar-2.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
<!DOCTYPE html>
<!--
Sculpture:
- Sketchfab: https://skfb.ly/ZMvC
- Origin: https://muzea.malopolska.pl/pl/lista-obiektow/192
- License: CC0
-->
<html>
<head>
<title>Tests for grabbing an object</title>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.misc.min.js"></script>
<script src="https://unpkg.com/super-hands@^3.0.3/dist/super-hands.min.js"></script>
</head>
<body>
<a-scene>
<a-assets timeout="5000">
<a-asset-item id="sculpture" src="sculpture.glb"></a-asset-item>
</a-assets>
<a-entity class="object"
geometry="primitive: box; width: 0.2; height: 0.02; depth: 0.02"
position="0 1.5 -0.5" rotation="0 0 0"
material="color: #4CC3D9; transparent: true; opacity: 0.5"
hoverable grabbable stretchable draggable dropppable>
<!-- <a-entity
geometry="primitive: box; width: 0.3; height: 0.3; depth: 0.3"
position="0 0.3 0" rotation="0 45 0" material="color: red">
</a-entity> -->
<a-entity gltf-model="#sculpture" scale="0.0005 0.0005 0.0005"
position="-0.1 0 0"></a-entity>
</a-entity>
<a-entity position="0 0 0" movement-controls="fly: false"
wasd-controls="acceleration: 10; fly: false">
<a-entity sphere-collider="objects: .object"
super-hands hand-controls="hand: left">
</a-entity>
<a-entity sphere-collider="objects: .object"
super-hands hand-controls="hand: right">
</a-entity>
<a-entity camera position="0 1.6 0" look-controls></a-entity>
</a-entity>
</a-scene>
</body>
</html>