Shader Learn

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
Explanation

Drag the underlined numbers left and right

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.

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