Atlaslog
Atlaslog / three.js / API reference / BufferGeometry
three.js · API reference

BufferGeometry

Quick answer

BufferGeometry stores vertex positions, normals, UVs, colors, and indices as GPU buffers, and serves as the geometry container for every Mesh, Line, and Points. Assemble it manually for point clouds, terrain, or custom meshes, and call computeVertexNormals() and computeBoundingSphere() after changing vertices. Use setAttribute() and setIndex() to populate it.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.BufferGeometry () → BufferGeometry
Key points
Example
const geometry = new THREE.BufferGeometry();
const positions = new Float32Array([
  -0.5, -0.5, 0,
   0.5, -0.5, 0,
   0.0,  0.5, 0
]);

geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
geometry.computeVertexNormals();
geometry.computeBoundingSphere();
const box = new THREE.BoxGeometry(1, 1, 1);
console.log(box.index !== null);        // true
console.log(box.attributes.position.count); // 24

const flat = box.toNonIndexed();
console.log(flat.attributes.position.count); // 36
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). BufferGeometry. https://www.jingweizhi.com/en/three/api/buffer-geometry.html (accessed 2026-11-03).