Capítulo 684 de 859

Chapter 684: BufferGeometryUtils

Core Idea

Reference for BufferGeometryUtils.

Code Examples

import * as BufferGeometryUtils from 'three/addons/utils/BufferGeometryUtils.js';
  • What it demonstrates: Typical usage of BufferGeometryUtils.

Reference Tables

Methods

MethodDescription
.computeMikkTSpaceTangents( geometry : BufferGeometry, MikkTSpace : Object, negateSign : boolean ) : BufferGeometry (inner)Computes vertex tangents using the MikkTSpace algorithm. MikkTSpace generates the same tangents consistently, and is used in most modelling tools and normal map bakers. Use MikkTSpace for materials w…
`.computeMorphedAttributes( object : MeshLine
.deepCloneAttribute( attribute : BufferAttribute ) : BufferAttribute (inner)Performs a deep clone of the given buffer attribute.
.deinterleaveAttribute( attribute : InterleavedBufferAttribute ) : BufferAttribute (inner)Returns a new, non-interleaved version of the given attribute.
.deinterleaveGeometry( geometry : BufferGeometry ) (inner)Deinterleaves all attributes on the given geometry.
.estimateBytesUsed( geometry : BufferGeometry ) : number (inner)Returns the amount of bytes used by all attributes to represent the geometry.
.interleaveAttributes( attributes : Array.<BufferAttribute> ) : Array.<InterleavedBufferAttribute> (inner)Interleaves a set of attributes and returns a new array of corresponding attributes that share a single InterleavedBuffer instance. All attributes must have compatible types.
.mergeAttributes( attributes : Array.<BufferAttribute> ) : BufferAttribute (inner)Merges a set of attributes into a single instance. All attributes must have compatible properties and types. Instances of InterleavedBufferAttribute are not support…
.mergeGeometries( geometries : Array.<BufferGeometry>, useGroups : boolean ) : BufferGeometry (inner)Merges a set of geometries into a single instance. All geometries must have compatible attributes.
.mergeGroups( geometry : BufferGeometry ) : BufferGeometry (inner)Merges the BufferGeometry#groups for the given geometry.
.mergeVertices( geometry : BufferGeometry, tolerance : number ) : BufferGeometry (inner)Returns a new geometry with vertices for which all similar vertex attributes (within tolerance) are merged.
.toCreasedNormals( geometry : BufferGeometry, creaseAngle : number ) : BufferGeometry (inner)Modifies the supplied geometry if it is non-indexed, otherwise creates a new, non-indexed geometry. Returns the geometry with smooth normals everywhere except faces that meet at an angle greater than…
.toTrianglesDrawMode( geometry : BufferGeometry, drawMode : number ) : BufferGeometry (inner)Returns a new indexed geometry based on TrianglesDrawMode draw mode. This mode corresponds to the gl.TRIANGLES primitive in WebGL.

Key Takeaways

  1. Key methods: computeMikkTSpaceTangents, computeMorphedAttributes, deepCloneAttribute, deinterleaveAttribute.

Connects To