Update: CC - Demo New - Key Up (194yv3pctj.js) 26 bytes modified
parent
f321b2f16e
commit
bb5d49e151
|
@ -39,16 +39,6 @@ if (data.code === 'KeyL') {
|
|||
var positions = [];
|
||||
var quaternions = [];
|
||||
var scales = [];
|
||||
var colors = [
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1,
|
||||
1,1,1
|
||||
];
|
||||
|
||||
for (x = 0; x < 128; x++) {
|
||||
for (y = 0; y < 128; y++) {
|
||||
|
@ -61,7 +51,8 @@ if (data.code === 'KeyL') {
|
|||
this.instancedGeometry.instance.attributes.position = this.boxGeometry.instance.attributes.position;
|
||||
//this.instancedGeometry.instance.attributes.color = this.boxGeometry.instance.attributes.color;
|
||||
|
||||
this.instancedGeometry.instance.addAttribute('color', new THREE.Float32BufferAttribute(colors, 3));
|
||||
|
||||
this.instancedGeometry.instance.removeAttribute('color');
|
||||
|
||||
this.instancedGeometry.instance.removeAttribute('instancePosition');
|
||||
this.instancedGeometry.instance.removeAttribute('instanceQuaternion');
|
||||
|
@ -71,13 +62,14 @@ if (data.code === 'KeyL') {
|
|||
this.instancedGeometry.instance.addAttribute('instanceQuaternion', new THREE.InstancedBufferAttribute( new Float32Array(quaternions), 4));
|
||||
this.instancedGeometry.instance.addAttribute('instanceScale', new THREE.InstancedBufferAttribute( new Float32Array(scales), 3));
|
||||
|
||||
this.instancedGeometry.instance.addAttribute('color', new THREE.Float32BufferAttribute(colors, 3));
|
||||
|
||||
this.instancedGeometry.instance.addGroup(0, 1000, 0);
|
||||
|
||||
this.meshImageGrid.geometry.instance = this.instancedGeometry.instance;
|
||||
//this.meshImageGrid.geometry.instance = this.instancedGeometry.instance;
|
||||
|
||||
this.meshImageGrid.materials[0].createInstance();
|
||||
this.meshImageGrid.updateInstance('materials');
|
||||
//this.meshImageGrid.materials[0].createInstance();
|
||||
//this.meshImageGrid.updateInstance('materials');
|
||||
|
||||
console.log('got data');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue