-
Notifications
You must be signed in to change notification settings - Fork 5
/
aframe-example.html
99 lines (94 loc) · 4.98 KB
/
aframe-example.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<!-- This example is based on an example from the A-Frame Examples Showcase.
The MIT License
Copyright © 2015-2017 A-Frame authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="utf-8">
<title>Hand Tracking! • A-Frame</title>
<meta name="description" content="Hand Tracking! • A-Frame">
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@56d77f99494e01b6918612c526ae514f45d178a4/dist/aframe-master.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/js/info-message.js"></script>
<script src="https://unpkg.com/aframe-environment-component@1.3.0/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/pinchable.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/color-change.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/slider.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/size-change.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/button.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/menu.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/pressable.js"></script>
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1.4.2/examples/showcase/hand-tracking/event-manager.js"></script>
<script src="../../components/desktop-xr-hands/dist/desktop-xr-hands.js"></script>
<link rel="stylesheet" href="../../styles.css">
</head>
<body>
<div class="text-overlay">
<p>A copy of <a href="https://aframe.io/examples/showcase/handtracking/">A-Frame Hand Tracking example</a> with desktop-xr-hands.</p>
<p>Enter full screen to enable hand tracking via webcam.</p>
</div>
<a class="code-link"
target="_blank"
href="https://github.com/diarmidmackenzie/aframe-components/blob/master/component-usage/desktop-xr-hands/aframe-example.html">
view code
</a>
<a-scene environment info-message="htmlSrc: #messageText">
<a-assets>
<a-asset-item id="messageText" src="message.html"></a-asset-item>
</a-assets>
<a-entity
id="boxGeometry"
position="0 2.0 -1"
rotation="45 45 0"
geometry="primitive: box; height: 0.6; width: 0.6; depth: 0.6"
material="color: #ff4b5c"
size-change
scale="0.5 0.5 0.5"
></a-entity>
<a-entity
id="torusGeometry"
position="0 2.0 -1"
rotation="45 45 0"
geometry="primitive: torus; radius: 0.4; radius-tubular: 0.06"
material="color: #d2e603"
size-change
visible="false"
scale="0.5 0.5 0.5"
></a-entity>
<a-entity
id="sphereGeometry"
position="0 2.0 -1"
rotation="45 45 0"
geometry="primitive: sphere; radius: 0.6;"
material="color: #fcdab7"
size-change
visible="false"
scale="0.5 0.5 0.5"
></a-entity>
<a-entity id="menu" menu position="0 1.5 -0.5" rotation="-45 0 0" event-manager>
<a-entity slider position="0 0.10 0"></a-entity>
<a-entity id="sphereButton" button="label: sphere" position="-0.15 0 0"></a-entity>
<a-entity id="boxButton" button="label: box" position="0 0 0"></a-entity>
<a-entity id="torusButton" button="label: torus" position="0.15 0 0"></a-entity>
<a-entity id="darkModeButton" button="label: Dark Mode; width: 0.20; toggable: true" position="0 -0.10 0"></a-entity>
</a-entity>
<a-entity desktop-xr-hands hand-tracking-controls="hand: left"></a-entity>
<a-entity desktop-xr-hands hand-tracking-controls="hand: right"></a-entity>
</a-scene>
</body>
</html>