-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
89 lines (83 loc) · 3.45 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prototype AR</title>
<link rel="stylesheet" href="/style.css">
<!-- Add A-Frame and AR.js libraries -->
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<!-- Add gesture detector and handler scripts -->
<script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-detector.js"></script>
<script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-handler.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/three.js/build/ar-threex.js"></script>
<script src="/script.js"></script>
</head>
<body style="margin: 0; overflow: hidden;">
<!-- Add a canvas element to apply the red-to-green camera filter -->
<canvas id="canvas"></canvas>
<!-- Add A-Frame scene -->
<a-scene
vr-mode-ui="enabled: false;"
loading-screen="enabled: false;"
arjs="trackingMethod: best; sourceType: webcam; debugUIEnabled: false;"
id="scene"
embedded
gesture-detector
>
<!-- Add marker -->
<a-marker
id="animated-marker"
type="pattern"
preset="custom"
url="assets/marker.patt"
raycaster="objects: .clickable"
emitevents="true"
cursor="fuse: false; rayOrigin: mouse;"
id="markerA"
>
<!-- Add text element -->
<a-text value="Prototype AR"
gesture-detector
color="yellow"
position="0 30 0"
rotation="-90 0 0"
scale="5 5 5"
font="https://cdn.aframe.io/fonts/Roboto-msdf.json">
</a-text>
<!-- Add image element -->
<a-image
src="assets/asset.png"
scale="3 1 1"
class="clickable"
rotation="-180 0 0"
gesture-handler
animation="property: rotation; to: 0 180 0; loop: true; easing: linear"
>
</a-image>
<!-- Add sphere elements -->
<a-sphere position="1.5" color="blue" radius ="0.15" gesture-handler>
<a-animation
attribute="color"
dur="10000"
from="blue"
to="orange"
repeat="indefinite">
</a-animation>
</a-sphere>
<a-sphere position="-1.5" color="red" radius ="0.15" gesture-handler>
<a-animation
attribute=" color"
dur="10000"
from="red"
to="green"
repeat="indefinite">
</a-animation>
</a-sphere>
</a-marker>
<!-- Add camera entity -->
<a-entity camera></a-entity>
</a-scene>
</body>
</html>