-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramming.html
More file actions
33 lines (25 loc) · 840 Bytes
/
programming.html
File metadata and controls
33 lines (25 loc) · 840 Bytes
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
<html>
<head>
<title>WebAR con A-Frame</title>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script>
AFRAME.registerComponent('cursor-listener', {
init: function () {
this.el.addEventListener('click', () => {
this.el.setAttribute('material', 'color', 'red')
this.el.setAttribute('animation', 'property: rotation; to: 120 120 120; dur: 3000; easing: easeInOutQuad')
})
}
})
</script>
</head>
<body>
<a-scene>
<a-entity id="box" cursor-listener geometry="primitive: box" material="color: blue" position="0 4 -5">
</a-entity>
<a-camera>
<a-cursor fuse="true" fuse-timeout="1500"></a-cursor>
</a-camera>
</a-scene>
</body>
</html>