-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathselection-mouse.html
More file actions
34 lines (32 loc) · 1.25 KB
/
selection-mouse.html
File metadata and controls
34 lines (32 loc) · 1.25 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
<!DOCTYPE html>
<!-- Selection 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.
-->
<html>
<head>
<script src="https://aframe.io/releases/1.4.0/aframe.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 cursor="rayOrigin:mouse"></a-entity>
</a-scene>
</body>
</html>