Update: CC - Demo New - Key Up (ip0443a52d.js) 169 bytes modified
parent
00301de172
commit
a224fc56a6
|
@ -33,7 +33,7 @@ if (data.code === 'KeyL') {
|
||||||
|
|
||||||
var offsets = [];
|
var offsets = [];
|
||||||
var orientations = [];
|
var orientations = [];
|
||||||
//var scales = [];
|
var scales = [];
|
||||||
|
|
||||||
var height = 0;
|
var height = 0;
|
||||||
|
|
||||||
|
@ -41,11 +41,11 @@ if (data.code === 'KeyL') {
|
||||||
for (y = 0; y < 128; y++) {
|
for (y = 0; y < 128; y++) {
|
||||||
|
|
||||||
height = heightData[(y * 128) + x] * 10;
|
height = heightData[(y * 128) + x] * 10;
|
||||||
scale = height * 0.1;
|
scale = height * 0.19;
|
||||||
|
|
||||||
offsets.push((x - 64) * 2, (64 - y) * 2, height);
|
offsets.push((x - 64) * 2, (64 - y) * 2, height);
|
||||||
orientations.push(0, 0, 0, 1);
|
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
|
4
|
||||||
).setDynamic(true);
|
).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('orientation', orientationAttribute);
|
||||||
|
this.instancedGeometry.instance.addAttribute('scale', scaleAttribute);
|
||||||
|
|
||||||
|
|
||||||
// this.instancedGeometry.instance.removeAttribute('color');
|
// this.instancedGeometry.instance.removeAttribute('color');
|
||||||
|
|
Loading…
Reference in New Issue