gpt4 book ai didi

three.js - 缓冲区几何和几何之间的区别

转载 作者:行者123 更新时间:2023-12-04 19:26:34 25 4
gpt4 key购买 nike

我是三个 JS 的新手,我研究了所有主题,如相机、渲染器、场景和几何。穿过几何体的地方有几何体和缓冲几何体(比如锥缓冲几何和锥几何)。两者的特征相同。那么几何和缓冲区几何之间的区别是什么。这是否会影响性能或其他方面的任何东西

最佳答案

区别主要在于底层数据结构(几何如何在内存中存储和处理顶点、面等)。

出于学习目的,您不应该关心它,只需使用 ConeGeometry 直到遇到性能问题。那就再回到正题,下次你会更有准备去搞清楚两者的区别。

请查收 BufferGeometry

An efficient representation of mesh, line, or point geometry. Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.

To read and edit data in BufferGeometry attributes, see BufferAttribute documentation.

For a less efficient but easier-to-use representation of geometry, see Geometry.



另一边 Geometry :

Geometry is a user-friendly alternative to BufferGeometry. Geometries store attributes (vertex positions, faces, colors, etc.) using objects like Vector3 or Color that are easier to read and edit, but less efficient than typed arrays.

Prefer BufferGeometry for large or serious projects.



BufferGeometry 性能解释如下: why-is-the-geometry-faster-than-buffergeometry

关于three.js - 缓冲区几何和几何之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54673268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com