diff --git a/ip0443a52d.js b/ip0443a52d.js index a42c21f..612130f 100644 --- a/ip0443a52d.js +++ b/ip0443a52d.js @@ -33,7 +33,7 @@ if (data.code === 'KeyL') { var offsets = []; var orientations = []; - //var scales = []; + var scales = []; var height = 0; @@ -41,11 +41,11 @@ if (data.code === 'KeyL') { for (y = 0; y < 128; y++) { height = heightData[(y * 128) + x] * 10; - scale = height * 0.1; + scale = height * 0.19; offsets.push((x - 64) * 2, (64 - y) * 2, height); orientations.push(0, 0, 0, 1); - //scales.push(scale, scale, scale); + scales.push(scale, scale, scale); } } @@ -82,8 +82,14 @@ if (data.code === 'KeyL') { 4 ).setDynamic(true); - this.instancedGeometry.instance.addAttribute('offset', offsetAttribute); + var scaleAttribute = new THREE.InstancedBufferAttribute( + new Float32Array(scales), + 3 + ); + + this.instancedGeometry.instance.addAttribute('offset', offsetAttribute); this.instancedGeometry.instance.addAttribute('orientation', orientationAttribute); + this.instancedGeometry.instance.addAttribute('scale', scaleAttribute); // this.instancedGeometry.instance.removeAttribute('color');