Twelve draw calls into one, and merges that fail
The wheel on the right is the merged geometry (spokes only, no rim). The two [error] lines are what mergeGeometries really logs.
A geometry is not frozen. You can change vertices every frame (and must tell the GPU with needsUpdate), draw only part of a shape with setDrawRange, and merge many shapes into one so the GPU draws them in a single call.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Make the cloth's wave stop when the user prefers reduced motion. Which line changes?
Write a function that grows a polyline: it keeps a big Float32Array for 1,000 points and draws only the first n.
Explain it without notes
Why must you set needsUpdate = true after editing a position array?
When would you use setDrawRange and when mergeGeometries?
Console
Nothing logged yet.Expected console output
12 meshes: 12 draw calls, 288 triangles
1 merged: 1 draw call, 288 triangles
THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index 1. Make sure all geometries have the same number of attributes.
different attributes -> null
THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index 1. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.
indexed + not indexed -> null
merged geometry: 480 vertices