Update: CC - Demo New - Key Up (ip0443a52d.js) 169 bytes modified

beta.r3js.org
-=yb4f310 2018-02-16 09:55:05 +01:00
parent 00301de172
commit a224fc56a6
1 changed files with 10 additions and 4 deletions

View File

@ -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');