Update: CC - Demo New - Key Up (194yv3pctj.js) 304 bytes modified

beta.r3js.org
-=yb4f310 2018-02-12 12:23:06 +01:00
parent 3b20ee86f7
commit adcc3b1a86
1 changed files with 11 additions and 1 deletions

View File

@ -23,9 +23,19 @@ if (data.code === 'KeyL') {
var heightData = this.imageSpoon.getHeightData();
var instances = 128 * 128;
var instances = 16384; //128 x 128
var x, y = 0;
var positions = [];
for (x = 0; x < 128; x++) {
for (y = 0; y < 128; y++) {
positions.push(x, y, heightData[(x * y) + x + y]);
}
}
this.instancedGeometry.instance.addAttribute('instancePosition', new THREE.InstancedBufferAttribute( new Float32Array(positions), 3));
console.log('got data');
}