From 8b0a67f86098f7e6ba6eafa32a3a30e70d3de51c Mon Sep 17 00:00:00 2001 From: "Diego F. Goberna" Date: Wed, 17 Oct 2018 02:31:23 +0200 Subject: [PATCH] tone down stage animation (fixes #123) --- src/components/beat-loader.js | 3 ++- src/components/stage-lasers.js | 8 ++++---- src/components/twister.js | 14 +++++++------- src/templates/stage.html | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/beat-loader.js b/src/components/beat-loader.js index 94f82dc..163f508 100644 --- a/src/components/beat-loader.js +++ b/src/components/beat-loader.js @@ -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); diff --git a/src/components/stage-lasers.js b/src/components/stage-lasers.js index 13ed409..93996c1 100644 --- a/src/components/stage-lasers.js +++ b/src/components/stage-lasers.js @@ -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; } }) \ No newline at end of file diff --git a/src/components/twister.js b/src/components/twister.js index 25b0083..3fc51f2 100644 --- a/src/components/twister.js +++ b/src/components/twister.js @@ -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; diff --git a/src/templates/stage.html b/src/templates/stage.html index 42b62ac..642e821 100644 --- a/src/templates/stage.html +++ b/src/templates/stage.html @@ -60,12 +60,12 @@ position="0 0 -50" scale="20 20 20"> - + + audio-columns="analyser: #audioAnalyser; height: 28; mirror: 10; scale: 6; thickness: 0.4; separation: 0.45" + position="0 -19 1">