How to use the InstancedBufferGeometry function from three
Find comprehensive JavaScript three.InstancedBufferGeometry code examples handpicked from public code repositorys.
GitHub: shaungt1/sketch-threejs
19 20 21 22 23 24 25 26 27 28
} this.instances = instances; this.obj = this.createObj(); } createObj() { const geometry = new THREE.InstancedBufferGeometry(); // Setting BufferAttribute const baseGeometry = new THREE.OctahedronBufferGeometry(30, 4); geometry.copy(baseGeometry);
260
0
0
GitHub: mrdavidlaing/ipyvolume
200 201 202 203 204 205 206 207 208
//console.log(geo) if(!geo) geo = "diamond" var buffer_geo = new THREE.BufferGeometry().fromGeometry(this.geos[geo]); var instanced_geo = new THREE.InstancedBufferGeometry(); var vertices = buffer_geo.attributes.position.clone(); instanced_geo.addAttribute('position', vertices);
236
0
2
GitHub: audunsh/evince
354 355 356 357 358 359 360 361 362 363
// this.camera.position.z = 2*Math.abs(this.box[2]); // //console.log("3d initt"); //} ///let instancedGeometry = new THREE.InstancedBufferGeometry().copy(baseGeometry); //let instanceCount = this.pos.length; //instancedGeometry.maxInstancedCount = instanceCount; //let material = new THREE.ShaderMaterial(); //let mesh = new THREE.Mesh(instancedGeometry, material);
3
7
0
GitHub: audunsh/evince
117 118 119 120 121 122 123 124 125 126
} let baseGeometry = new THREE.SphereBufferGeometry(.3); //let baseGeometry = new THREE.BoxBufferGeometry(1.0,1.0,1.0); let instancedGeometry = new THREE.InstancedBufferGeometry().copy(baseGeometry); let instanceCount = this.state.length; instancedGeometry.maxInstancedCount = instanceCount; //let material = new THREE.ShaderMaterial(); //let mesh = new THREE.Mesh(instancedGeometry, material);
3
7
0
GitHub: ASLS-org/studio
389 390 391 392 393 394 395 396 397 398 399
var intensity_buffer_attribute = new THREE.InstancedBufferAttribute(new Float32Array(MAX_INSTANCES), 1).setDynamic(true) var color_buffer_attribute = new THREE.InstancedBufferAttribute(new Float32Array(MAX_INSTANCES * 3), 3).setDynamic(true) var emissive_buffer_attribute = new THREE.InstancedBufferAttribute(new Float32Array(MAX_INSTANCES), 1).setDynamic(true) var angle_buffer_attribute = new THREE.InstancedBufferAttribute(new Float32Array(MAX_INSTANCES * 2), 2).setDynamic(true) var baseGeo = new THREE.InstancedBufferGeometry(); var yokeGeo = new THREE.InstancedBufferGeometry(); var headGeo = new THREE.InstancedBufferGeometry(); var beamGeo = new THREE.InstancedBufferGeometry(); var targetGeo = new THREE.InstancedBufferGeometry();
0
7
0
+ 23 other calls in file
3 4 5 6 7 8 9 10 11 12 13 14 15 16
*/ const THREE = require('three'); THREE.LineSegmentsGeometry = function () { THREE.InstancedBufferGeometry.call( this ); this.type = 'LineSegmentsGeometry'; var plane = new THREE.BufferGeometry();
0
0
1
+ 33 other calls in file
three.Vector3 is the most popular function in three (22341 examples)