-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
174 lines (156 loc) · 9.27 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> What is this? </title>
<meta name="description" content="Music in WebVR by combining A-Frame and Tone.js">
<link rel="icon" href="favicon.png" sizes="16x16" type="image/png">
<script type="text/javascript" src="bundle.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v6.0.0/dist/aframe-extras.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/super-hands.min.js"></script>
<script src="https://unpkg.com/aframe-physics-extras/dist/aframe-physics-extras.min.js"></script>
<script src="https://unpkg.com/aframe-mirror-component/dist/aframe-mirror-component.min.js"></script>
</head>
<body>
<a-scene physics="debug: false; gravity: -2; restitution: 0.99; angularDamping: 0.2" cursor="rayOrigin: mouse">
<a-assets>
<audio id="sfx-gun" src="https://cdn.glitch.com/1d750fac-a652-409d-949b-156f935085a2%2Ftrimmed-40MM%20M79%20grenade%20launcher%20single%20shot%20close%20perspective_BLASTWAVEFX_09562.mp3?1510643217955" crossorigin="anonymous" ></audio>
<!-- FONTS
<a-asset-item id="block" src="./assets/fonts/BlockUp_Regular.json"></a-asset-item>
-->
<a-mixin id="step"
geometry="primitive: dodecahedron"
>
</a-mixin>
<a-mixin id="wall" class="wall" geometry="primitive: box" static-body force-pushable></a-mixin>
<a-mixin id="grainPlayer"
geometry="primitive: sphere; radius: 0.3;"
dynamic-body="shape: sphere"
material="shader: noise"
>
</a-mixin>
<a-mixin id="monoSynth"
geometry="primitive: sphere; radius: 0.2"
dynamic-body="shape: sphere"
material="color: pink; metalness: 0.9"
>
</a-mixin>
<a-mixin id="polySynth"
geometry="primitive: sphere; radius: 0.2"
dynamic-body="shape: sphere"
material="shader: grid-glitch"
>
</a-mixin>
<a-mixin id="touch"
physics-collider phase-shift
collision-filter="collisionForces: false"
static-body="shape: sphere; sphereRadius: 0.02"
super-hands="colliderEvent: collisions;
colliderEventProperty: els;
colliderEndEvent: collisions;
colliderEndEventProperty: clearedEls;"></a-mixin>
<a-mixin id="ammo"
grabbable
event-set__hoveron="_event: hover-start; material.opacity: 0.7; transparent: true"
event-set__hoveroff="_event: hover-end; material.opacity: 1; transparent: false"
shadow></a-mixin>
</a-assets>
<a-entity id="cameraRig" position="0 0 0" rotation="0 0 0">
<a-camera look-controls wasd-controls></a-camera>
</a-entity>
<a-entity
environment="preset: yavapai; shadow:true; seed: 13; dressing: stones; lightPosition: 0.7 0.7 0.7">
</a-entity>
<!-- Log
<a-entity
log="channel: master" geometry="primitive: plane; height: 5" material
position="-2 0 -2" rotation="0 45 0"
></a-entity>
-->
<!-- Sequencer -->
<a-entity id="sequencerWrapper" position="0 0 -2" rotation="0 30 0">
<a-entity id="play-pause" class="step upForGrab" geometry="primitive: dodecahedron; radius: 0.1" material="color: #F6F7A7;" play-pause position="0 2 0" radius="0.3"></a-entity>
<a-entity id="transport"
bind__transport="bpm: bpm; layers: layers"
>
<!-- steps are injected dynamically inside this entity -->
</a-entity>
</a-entity>
<!-- object spawner (for debugging purposes) -->
<a-entity hide-in-vr visible="true" class="shooter" shooter sound="src: #sfx-gun; autoplay: false; volume: 0.6" random-material geometry="primitive: sphere; radius: 0.3" position="0 4 -3">
<a-text value="point at me" position="-0.3 0.5 0" width="3"></a-text>
<a-text value="then click me" position="-0.35 -0.5 0" width="3"></a-text>
</a-entity>
<!-- Physics terrain ground -->
<a-box width="75" height="10" depth="75" position="0 -4.995 0" static-body visible="false"></a-box>
<!-- Walls -->
<a-entity position="0 0 2">
<!-- invisible borders -->
<a-entity splash mixin="wall" class="wall" visible="false" geometry="width: 6; height: 100; depth: 0.3" position="0 0 -6"></a-entity>
<a-entity splash mixin="wall" class="wall" visible="false" geometry="width: 7; height: 100; depth: 0.3" position="-2.5 0 -3" rotation="0 90 0"></a-entity>
<a-entity splash mixin="wall" class="wall" visible="false" geometry="width: 7; height: 100; depth: 0.3" position="2.5 0 -3" rotation="0 -90 0"></a-entity>
<a-entity splash mixin="wall" class="wall" visible="false" geometry="width: 6; height: 100; depth: 0.3" position="0 0 0"></a-entity>
<!-- visual indicators of the border -->
<a-entity mixin="wall" material="color: #EF2D5E" class="wall" geometry="width: 6; height: 0.1; depth: 0.3" position="0 0 -6"></a-entity>
<a-entity mixin="wall" material="color: #EF2D5E" class="wall" geometry="width: 7; height: 0.1; depth: 0.3" position="-2.5 0 -3" rotation="0 90 0"></a-entity>
<a-entity mixin="wall" material="color: #EF2D5E" class="wall" geometry="width: 7; height: 0.1; depth: 0.3" position="2.5 0 -3" rotation="0 -90 0"></a-entity>
<a-entity mixin="wall" material="color: #EF2D5E" class="wall" geometry="width: 6; height: 0.1; depth: 0.3" position="0 0 0"></a-entity>
</a-entity>
<a-entity collide-sound="target: wall; source: monoSynth" class="ammo" mixin="ammo monoSynth" position="0 0 -1"></a-entity>
<a-entity collide-sound="target: wall; source: polySynth" class="ammo" mixin="ammo polySynth" position="0 0 -1.5"></a-entity>
<a-entity collide-sound="target: wall; source: grainPlayer" class="ammo" mixin="ammo grainPlayer" position="1 0 -2.5"></a-entity>
<!-- Cylinder synth -->
<a-entity position="-0.17 0 0.6" rotation="0 132 0">
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="1.2" position="0 0 0">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.6" position="0.5 0 0">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.8" position="1 0 0">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.7" position="1.5 0 0">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="1.2" position="0 0 -0.51">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.6" position="0.5 0 -0.51">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.8" position="1 0 -0.51">
</a-cylinder>
<a-cylinder material="color: pink; roughness: 0; metalness: 0" synth="source: oscillator" class="cylinder upForGrab" radius="0.1" height="0.7" position="1.5 0 -0.51">
</a-cylinder>
<a-cylinder material="color: purple; roughness: 0; metalness: 0" synth="source: phaser" class="cylinder upForGrab" radius="0.1" height="0.5" position="0.5 0 -1">
<a-entity position="0.5 1 0" text="value: Phaser"></a-entity>
</a-cylinder>
<a-cylinder material="color: purple; roughness: 0; metalness: 0" synth="source: detune" class="cylinder upForGrab" radius="0.1" height="1" position="-0.5 0 -1">
<a-entity position="0.5 1 0" text="value: Detune"></a-entity>
</a-cylinder>
<a-cylinder material="color: purple; roughness: 0; metalness: 0" synth="source: volume" class="cylinder upForGrab" radius="0.1" height="2" position="0 0 -1.5">
<a-entity position="0.5 1 0" text="value: Volume"></a-entity>
</a-cylinder>
<a-cylinder material="color: purple; roughness: 0; metalness: 0" synth="source: pingPong" class="cylinder upForGrab" radius="0.1" height="1" position="1 0 -1.5">
<a-entity position="0.5 1 0" text="value: Delay"></a-entity>
</a-cylinder>
</a-entity>
<!-- VR interaction -->
<a-entity id="rhand" mixin="touch"
vive-controls="hand: right"
oculus-touch-controls="hand: right"
windows-motion-controls="hand: right"
aabb-collider="objects: .upForGrab;"
grab-fork="target: step"
grab-vertical="target: cylinder; heightRange: 0.5 3"
haptics
>
</a-entity>
<a-entity id="lhand" mixin="touch"
vive-controls="hand: left"
oculus-touch-controls="hand: left"
windows-motion-controls="hand: left"
aabb-collider="objects: .upForGrab;"
grab-fork="target: step"
grab-vertical="target: cylinder; heightRange: 0.5 3"
haptics
>
</a-entity>
</a-scene>
</body>
</html>