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
Exercise
Drag the underlined numbers left and rightDrag numbers, or edit the code
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.JS side
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