Shader Learn

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
Explanation

Drag the underlined numbers left and right

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.

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