From 54f114e64cf3c14e9ebe6cd422deebc49804f29a Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 16 Feb 2018 12:22:41 +0100 Subject: [PATCH] Update: CC - Demo New - Before Render (wlw063ovw9.js) 45 bytes modified --- wlw063ovw9.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/wlw063ovw9.js b/wlw063ovw9.js index e2fdaaf..c9a1c8a 100644 --- a/wlw063ovw9.js +++ b/wlw063ovw9.js @@ -7,6 +7,7 @@ if (!this.initialized) { /** * attributeData hols the new attribute data we want to animate to */ + this.startAnimation = false; this.animate = false; this.attributeData = null; @@ -21,21 +22,22 @@ if (!this.initialized) { this.time += 0.1 * data.delta; -if (this.animate) { +if (this.startAnimation) { this.time = 0; + this.animation = true; + this.startAnimation = false; } -if (this.time < 1) { - //start interpolating - this.updateAttributeArrays(this.time); -} else { - if (this.animate) { - //perform the last update +if (this.animate) { + if (this.time < 1) { + this.updateAttributeArrays(this.time); + } else { this.updateAttributeArrays(1); this.animate = false; - } + } } + //this.camera.position.x = 10;Math.sin(this.time) * 4;// * (window.innerWidth - (window.innerWidth / 2)); //this.camera.position.y = 10;Math.sin(this.time / 2) * 4;//Math.cos(this.time) * (window.innerHeight - (window.innerHeight / 2)); //this.camera.position.z = 10;-Math.sin(this.time) * 5;//Math.sin(this.camera.position.y) * Math.cos(this.camera.position.x);