Group Transforms

Nested Groups compose transforms: outer rotates, inner scales, meshes inherit both.

import * as EASEL from "easel";

const outerGroup = new EASEL.Group();
scene.add(outerGroup);

const innerGroup = new EASEL.Group();
outerGroup.add(innerGroup);

const mesh = new EASEL.Mesh(geometry, material);
mesh.position.set(2, 0, 0);
innerGroup.add(mesh);

outerGroup.rotation.y += 0.6 * dt;

const s = 0.8 + 0.4 * Math.abs(Math.sin(elapsed * 1.2));
innerGroup.scale.set(s, s, s);