From f121ccbaaf18d6acc24f95cf2350619b293a6c1d Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Mon, 12 Feb 2018 14:34:31 +0100 Subject: [PATCH] Update: CC - Demo New - Key Up (194yv3pctj.js) 110 bytes modified --- 194yv3pctj.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/194yv3pctj.js b/194yv3pctj.js index cbaedfa..cd4344f 100644 --- a/194yv3pctj.js +++ b/194yv3pctj.js @@ -48,7 +48,7 @@ if (data.code === 'KeyL') { height = heightData[(y * 128) + x] * 10; scale = height * 0.1; - positions.push(x, 128 - y, height); + positions.push(x - 64, 64 - y, height); quaternions.push(0, 0, 0, 1); scales.push(scale, scale, scale); } @@ -70,7 +70,9 @@ if (data.code === 'KeyL') { this.instancedGeometry.instance.addAttribute('color', new THREE.Float32BufferAttribute(colors, 3)); - this.instancedGeometry.instance.addGroup(0, 5, 0); + this.instancedGeometry.instance.clearGroups(); + + this.instancedGeometry.instance.addGroup(0, this.instancedGeometry.instance.attributes.position.count, 0); //this.meshImageGrid.geometry.instance = this.instancedGeometry.instance;