tone down stage animation (fixes #123)

This commit is contained in:
Diego F. Goberna
2018-10-17 02:31:23 +02:00
parent 2da93bcab8
commit 8b0a67f860
4 changed files with 16 additions and 15 deletions

View File

@@ -258,7 +258,8 @@ AFRAME.registerComponent('beat-loader', {
this.twister.components.twister.pulse(event._value);
break;
case 9:
this.twister.components.twister.zoom(event._value);
// zoom was a bit disturbing
this.twister.components.twister.pulse(event._value);
break;
case 12:
this.leftStageLasers.components['stage-lasers'].pulse(event._value);

View File

@@ -13,21 +13,21 @@ AFRAME.registerComponent('stage-lasers', {
},
pulse: function (speed) {
this.speed = speed / 5;
this.speed = speed / 8;
},
tick: function (time, delta) {
if (this.speed === 0) { return; }
delta /= 1000;
if (!this.data.enabled) {
this.speed *= 0.96;
this.speed *= 0.97;
if (Math.abs(this.speed) < 0.01) {
this.speed = 0;
return;
}
}
this.lasers[0].rotation.z += this.speed * delta;
this.lasers[1].rotation.z -= this.speed * delta * 1.04;
this.lasers[2].rotation.z += this.speed * delta * 1.1;
this.lasers[1].rotation.z -= this.speed * delta * 1.01;
this.lasers[2].rotation.z += this.speed * delta * 1.02;
}
})

View File

@@ -3,10 +3,10 @@ AFRAME.registerComponent('twister', {
enabled: {default: false},
twist: {default: 0},
vertices: {default: 4, type: 'int'},
count: {default: 20, type: 'int'},
positionIncrement: {default: 2},
radiusIncrement: {default: 0.5},
thickness: {default: 0.4}
count: {default: 12, type: 'int'},
positionIncrement: {default: 1.4},
radiusIncrement: {default: 0.40},
thickness: {default: 0.37}
},
init: function () {
@@ -17,8 +17,8 @@ AFRAME.registerComponent('twister', {
pulse: function (twist) {
if (!this.data.enabled) { return; }
if (twist == 0) { twist = 0.05 + Math.random() * 0.15; }
else twist = Math.min(twist * 0.5, 0.5);
if (twist == 0) { twist = 0.03 + Math.random() * 0.25; }
else twist = Math.min(twist * 0.4, 0.4);
twist *= Math.random() < 0.5 ? -1 : 1; // random direction
this.el.setAttribute('twister', {twist: twist});
},
@@ -30,7 +30,7 @@ AFRAME.registerComponent('twister', {
},
update: function (oldData) {
var radius = 4;
var radius = 6;
var segment;
var lastSegment;

View File

@@ -60,12 +60,12 @@
position="0 0 -50"
scale="20 20 20"></a-entity>
<a-entity id="twister" position="0 0 -60" rotation="90 0 0" bind__twister="enabled: isPlaying"></a-entity>
<a-entity id="twister" position="0 0 -35" rotation="90 0 0" bind__twister="enabled: isPlaying"></a-entity>
<a-entity
id="audioColumns"
audio-columns="analyser: #audioAnalyser; height: 28; mirror: 10; scale: 10; thickness: 0.4; separation: 0.45"
position="0 -17 1"></a-entity>
audio-columns="analyser: #audioAnalyser; height: 28; mirror: 10; scale: 6; thickness: 0.4; separation: 0.45"
position="0 -19 1"></a-entity>
<a-mixin id="corridor" geometry="skipCache: true" vertex-colors-buffer="baseColor: #010101" visible="false"></a-mixin>
<a-entity id="stageCorridor" buffer-geometry-merger material="shader: flat; flatShading: true; vertexColors: vertex">