08 What Three.js writes for you
Model: more than one shape gets loaded
Load a small model with a hierarchy from a local JSON file.
0.51.4
Exercise
Drag the underlined numbers left and rightDrag numbers, or edit the code
const loader = new THREE.ObjectLoader();const model = await loader.loadAsync( './assets/model.json');model.scale.setScalar();scene.add(model);// wireframe =
Model fileCan contain several meshes, materials and parent-child links.JS side
A model file holds several meshes, materials and a hierarchy; once loaded they are all objects you already know.
Try it
- Turn on the wireframe and count the parts