How to use the Uint32BufferAttribute function from three

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

1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
const martini = new Martini(gridSize);
const tile = martini.createTile(terrain);
const { vertices, triangles } = tile.getMesh(typeof this.meshMaxError === 'function' ? this.meshMaxError(this.level) : this.meshMaxError);
const attributes = MapMartiniHeightNode.getMeshAttributes(vertices, terrain, tileSize, [-0.5, -0.5, 0.5, 0.5], this.exageration);
this.geometry = new three.BufferGeometry();
this.geometry.setIndex(new three.Uint32BufferAttribute(triangles, 1));
this.geometry.setAttribute('position', new three.Float32BufferAttribute(attributes.position.value, attributes.position.size));
this.geometry.setAttribute('uv', new three.Float32BufferAttribute(attributes.uv.value, attributes.uv.size));
this.geometry.rotateX(Math.PI);
var texture = new three.Texture(image);
fork icon75
star icon468
watch icon0

804
805
806
807
808
809
810
811
812
813
    coneAttributes.indices.value.push(ix21);
    ix21 += 1;
  }
});
coneGeom.setIndex(
  new THREE.Uint32BufferAttribute(coneAttributes.indices.value, 1)
);
coneGeom.setAttribute(
  "position",
  new THREE.Float32BufferAttribute(coneAttributes.vertices.value, 3)
fork icon7
star icon21
watch icon0

+ 3 other calls in file

210
211
212
213
214
215
216
217
218
219
case Uint32Array:
attributeData = new dracoDecoder.DracoUInt32Array();
decoder.GetAttributeUInt32ForAllPoints(
    dracoGeometry, attribute, attributeData);
geometryBuffer[ attributeName ] = new Uint32Array( numValues );
TypedBufferAttribute = THREE.Uint32BufferAttribute;
break;

default:
var errorMsg = 'THREE.DRACOLoader: Unexpected attribute type.';
fork icon4
star icon26
watch icon0

+ 5 other calls in file

433
434
435
436
437
438
439
440
441

geometry.drawMode = this.drawMode;
if (geometryType == dracoDecoder.TRIANGULAR_MESH) {
  geometry.setIndex(
    new (geometryBuffer.indices.length > 65535
      ? THREE.Uint32BufferAttribute
      : THREE.Uint16BufferAttribute)(geometryBuffer.indices, 1)
  );
}
fork icon3
star icon7
watch icon8

+ 29 other calls in file

301
302
303
304
305
306
307
308
309
310
if (this.generateUVs) {
    this.uvs = new Float32Array(maxVerts * 2);
}
// Populate the mesh
this.fillMesh(0);
this.setIndex(new three_1.Uint32BufferAttribute(this.indices, 1));
this.positionAttribute = new three_1.Float32BufferAttribute(this.vertices, 3);
this.setAttribute('position', this.positionAttribute);
if (this.generateUVs) {
    this.uvsAttribute = new three_1.Float32BufferAttribute(new Float32Array(this.uvs), 2);
fork icon1
star icon3
watch icon0

Other functions in three

Sorted by popularity

function icon

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