返回介绍

手册

参考

示例

开发者参考

BufferGeometryUtils

发布于 2021-07-10 14:14:20 字数 2947 浏览 1646 评论 0 收藏 0

A class containing utility functions for BufferGeometry instances.

Methods

.mergeBufferGeometries ( geometries : Array, useGroups : Boolean ) : BufferGeometry

geometries -- Array of BufferGeometry instances.
useGroups -- Whether groups should be generated for the merged geometry or not.

Merges a set of geometries into a single instance. All geometries must have compatible attributes. If merge does not succeed, the method returns null.

.mergeBufferAttributes ( attributes : Array ) : BufferAttribute

attributes -- Array of BufferAttribute instances.

Merges a set of attributes into a single instance. All attributes must have compatible properties and types, and InterleavedBufferAttributes are not supported. If merge does not succeed, the method returns null.

.interleaveAttributes ( attributes : Array ) : InterleavedBufferAttribute

attributes -- Array of BufferAttribute instances.

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. If merge does not succeed, the method returns null.

.estimateBytesUsed ( geometry : BufferGeometry ) : Number

geometry -- Instance of BufferGeometry to estimate the memory use of.

Returns the amount of bytes used by all attributes to represent the geometry.

.mergeVertices ( geometry : BufferGeometry, tolerance : Number ) : BufferGeometry

geometry -- Instance of BufferGeometry to merge the vertices of.
tolerance -- The maximum allowable difference between vertex attributes to merge. Defaults to 1e-4.

Returns a new BufferGeometry with vertices for which all similar vertex attributes (within tolerance) are merged.

.toTrianglesDrawMode ( geometry : BufferGeometry, drawMode : TrianglesDrawMode ) : BufferGeometry

geometry -- Instance of BufferGeometry.
drawMode -- The draw mode of the given geometry.

Returns a new indexed BufferGeometry based on the THREE.TrianglesDrawMode draw mode. This mode corresponds to the gl.TRIANGLES WebGL primitive.

Source

examples/jsm/utils/BufferGeometryUtils.js

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文