Shader Learn

06 Space, camera and depth

Scene: a parent carries its children

Turn the parent; the child turns along with it.

-3.143.14
1.22.6
Explanation

Drag the underlined numbers left and right

parent.add(mesh);parent.add(child);parent.rotation.y = ;child.position.x = ;scene.add(parent);
Parent and childA child’s local position is transformed together with its parent.

A scene is a tree: a child’s local position is transformed along with its parent — matrix multiplication underneath.

Try it

  • Turn the parent and watch the child follow
  • Move the child further away