How to use the InstancedBufferGeometry function from three

Find comprehensive JavaScript three.InstancedBufferGeometry code examples handpicked from public code repositorys.

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);
fork icon260
star icon0
watch icon0

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);
fork icon236
star icon0
watch icon2

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);
fork icon3
star icon7
watch icon0

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);
fork icon3
star icon7
watch icon0

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();
fork icon0
star icon7
watch icon0

+ 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();
fork icon0
star icon0
watch icon1

+ 33 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)