From 60887438fa29ddad1c3517d79f1ac25efeb91593 Mon Sep 17 00:00:00 2001 From: David Lyons Date: Thu, 25 Feb 2016 18:17:14 -0800 Subject: [PATCH] Fix for texture animation When a texture animation has multiple rows, like the explosion boomer, it was cycling through the frames in the wrong order. This fix starts with the top row and moves down, instead of starting with the bottom row and moving up. Tile 0 is now the top left, rather than the bottom left. --- Three.js/Texture-Animation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Three.js/Texture-Animation.html b/Three.js/Texture-Animation.html index c1a4127..ca3e2d2 100644 --- a/Three.js/Texture-Animation.html +++ b/Three.js/Texture-Animation.html @@ -188,7 +188,7 @@ var currentColumn = this.currentTile % this.tilesHorizontal; texture.offset.x = currentColumn / this.tilesHorizontal; var currentRow = Math.floor( this.currentTile / this.tilesHorizontal ); - texture.offset.y = currentRow / this.tilesVertical; + texture.offset.y = ( - currentRow - 1 ) / this.tilesVertical; } }; }