08 What Three.js writes for you
Mesh: shape plus material makes an object
Change the shape, keep the material; then change the colour.
-11
0.51.4
Exercise
Drag the underlined numbers left and rightDrag numbers, or edit the code
const geometry = new THREE.();const material = new THREE.MeshStandardMaterial({ color: });const mesh = new THREE.Mesh(geometry, material);mesh.position.x = ;mesh.scale.setScalar();scene.add(mesh);
MeshGeometry + Material + object transform.JS side
Mesh = Geometry (data) + Material (shader) + transform (matrix).
Try it
- Change the shape; the material stays
- Move the object all the way left and make it as small as possible