Drawing only part of a ring
The ring grows and shrinks by changing only the draw range. Watch the triangle count in the status bar go up and down while the geometry count stays 1.
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
index entries: 3456 = triangles: 1152
100% -> 1152 triangles drawn
50% -> 576 triangles drawn
25% -> 288 triangles drawn
0% -> 0 triangles drawn
count 10 -> 3.3333333333333335 triangles counted