-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVRinteraction3.html
48 lines (41 loc) · 1.9 KB
/
VRinteraction3.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
48
<!DOCTYPE html>
<html>
<head>
<title>A-Frame VR - Interaction 2 Super-hands - draggable </title>
<!-- Based on udemy A-Frame L23-->
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<!-- <script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script> -->
<!-- Script for event-set -->
<script src="https://unpkg.com/aframe-event-set-component@^4.0.0/dist/aframe-event-set-component.min.js"></script>
<!-- Not working with [email protected]>
<script src="https://unpkg.com/[email protected]/dist/super-hands.min.js"></script>
</head>
<body>
<a-scene>
<!-- progressive-controls - raycaster with animated circle -->
<a-entity progressive-controls></a-entity>
<!-- Box draggable -->
<a-box color="green" position="-2.25 0 -9" scale="2 1 0.1" draggable
event-set__drag="_event: drag-drop; target: #bluebox; color: red"
>
<a-text value="Drag me (stationary)" position="-0.5 0.7 0" color="green"></a-text>
</a-box>
<!-- Box draggable with grabbable-->
<a-box color="green" position="-2.25 2 -9" scale="2 1 0.1" draggable grabbable
event-set__drag="_event: drag-drop; target: #bluebox; color: red"
event-set__end ="_event: grab-end"
>
<a-text value="Drag me" position="-0.5 0.7 0" color="green"></a-text>
</a-box>
<!-- Box with droppable to drop on to change color of draggable box-->
<a-box color="blue" position="2.25 0 -9" scale="2 1 0.1" id="bluebox" droppable
>
<a-text value="drop on me to change color" position="-0.5 0.7 0" color="blue"></a-text>
</a-box>
<!-- Box just for position reference -->
<a-box color="#212121" position="0 0 -9" scale="2 1 0.1"
>
</a-box>
</a-scene>
</body>
</html>