用途:面向 React Three Fiber(R3F)开发者的几何体技能资料,说明 3D 物体的形状如何通过顶点、面、法线、UV 等 buffer 属性定义。
主要能力:
- 内置几何体:box、sphere、plane、cylinder、cone、torus、torusKnot、ring、circle、dodecahedron、icosahedron、octahedron、tetrahedron,均以 args 数组对应构造参数。
- 自定义几何体:用 THREE.BufferGeometry 配合 Float32Array 设置 position、normal、uv,或用声明式 bufferAttribute(attach="attributes-position")。
- 索引几何体:用 setIndex 复用顶点,再用 computeVertexNormals 计算法线。
- 动态更新:在 useFrame 中修改 position 属性并设置 needsUpdate。
- 实例化:instancedMesh 一次绘制大量相同物体,支持实例颜色 setColorAt 与自定义 InstancedBufferAttribute。
- 工具:computeVertexNormals、computeBoundingBox/Sphere、center、mergeGeometries、dispose。
使用方式:作为开发参考,把示例代码嵌入 R3F 组件,按 args 顺序传参,按属性名 attach。
适用场景:需要自定义或高性能渲染大量 3D 物体时。
限制:文档未说明版本要求、许可、收费与具体性能数字,也未提供官方博客或收录说明,相关内容暂未提供。