-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathselection-2.html
More file actions
48 lines (43 loc) · 1.84 KB
/
selection-2.html
File metadata and controls
48 lines (43 loc) · 1.84 KB
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>
<!-- Selection in desktop and Oculus Go
When in desktop:
Click, mouseenter and mouseleave on objects with the corresponding
animations, activated with the desktop mouse.
Thanks to 'cursor="rayOrigin:mouse"' in the scene.
When in Oculus Go:
Click, mouseenter and mouseleave on objects with the corresponding
animations, activated with the ray controlled with the Go control
(using the trigger to activate "click").
Thanks to the laser-controls element.
-->
<html>
<head>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.1/dist/aframe-extras.min.js"></script>
</head>
<body>
<a-scene>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow
animation="startEvents: click; property: position;
from: -1 1.5 -3; to: -1 0.5 -3 dur: 1000">
</a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow
animation="startEvents: click; property: scale;
from: 2 2 2; to: 1 1 1; dur: 1000">
</a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow
animation__enter="startEvents: mouseenter; property: scale;
to: 2 2 2; dur: 1000"
animation__leave="startEvents: mouseleave; property: scale;
to: 1 1 1; dur: 1000">
</a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>
<a-sky color="#ECECEC"></a-sky>
<a-entity movement-controls="fly: true" position="0 0 0">
<a-entity camera position="0 1.6 0" look-controls></a-entity>
<a-entity cursor="rayOrigin:mouse"></a-entity>
<a-entity laser-controls="hand: right"></a-entity>
</a-entity>
</a-scene>
</body>
</html>