r3f-learning-01

LESSON 12

Models

useGLTF("/models/DamagedHelmet.glb") streams a glTF, parses meshes/materials/animations, and returns the parsed result. Drop the result into the JSX tree via <primitive object={scene} />, or walk nodes/materials and rebuild it declaratively.

Hint with useGLTF.preload(url) at module scope to warm the cache before mount. If the same model appears in multiple places, clone scene via SkeletonUtils.clone() — sharing one Object3D across the tree breaks transforms.