-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterm3.html
65 lines (56 loc) · 2.26 KB
/
interm3.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
<!DOCTYPE html>
<html>
<head>
<title>A-Frame, (interm3) tutorial - debugging positions </title>
<script src="https://cdn.rawgit.com/aframevr/aframe/master/dist/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-camera position="0 1.8 0"><a-cursor fuse="true" color="#2E3A87" timeout="1000">
<a-animation begin="cursor-click" easing="ease-in" attribute="scale" dur="800"
fill="backwards" from="1.0 1.0 1.0" to="100 100 100">
</a-animation>
</a-camera>
<a-sky src="http://aupano.autodesk.com/panos/beb33bL.jpg"></a-sky>
<a-box color="orange" position="-2 2 -10" mixin="waypt" href="lightpink">
<a-animation mixin="enter"></a-animation>
<a-animation mixin="leave"></a-animation>
<a-animation mixin="spin" ></a-animation>
</a-box>
<a-box color="lightblue" position="-10 2 -10" mixin="waypt" href="lightblue">
<a-animation mixin="enter"></a-animation>
<a-animation mixin="leave"></a-animation>
<a-animation mixin="spin" ></a-animation>
</a-box>
<a-box color="green" position="4 2 -10" mixin="waypt" href="lightgreen">
<a-animation mixin="enter"></a-animation>
<a-animation mixin="leave"></a-animation>
<a-animation mixin="spin" ></a-animation>
</a-box>
<a-mixin id="waypt" rotation="0 0 45" scale="2 2 3"></a-mixin>
<a-mixin id="enter" begin="cursor-mouseenter" easing="ease-in" attribute="scale" dur="200" to="4 4 4"></a-mixin>
<a-mixin id="leave" begin="cursor-mouseleave" easing="ease-out" attribute="scale" dur="200" to="2 2 2"></a-mixin>
<a-mixin id="spin" attribute="rotation" dur="10000" fill="forwards" to="0 360 25" repeat="indefinite"></a-mixin>
</a-scene>
</body>
<script>
var app = {
init: function() {
// Add Click handler's to our waypoints in javascript
[].forEach.call(document.querySelectorAll('a-box'), function(box) {
box.addEventListener('cursor-click', function () {
app.setSkybox( box.getAttribute('href') );
});
});
},
setSkybox: function(color) {
document.querySelector('a-sky').setAttribute('color', color);
},
hideWaypoints: function(boxid) {
},
moveCamera: function(newPosition, camera) {
},
}
app.init();
</script>
</html>