Skip to content

Transforms

The object to scene transform can be set with:

    auto M = Mesh::Add("bunny.obj");
    M->localTransform = Transform::ScalePositionRotate(...);

Each object transform can be controled on each slide with the at method:

    show << M->at(vec(1,1,1)) // same as at(Transform::Translation(x));
    show << inNextFrame << M->at(vec(-1,-1,-1)); // will transition between transforms

Persistent transform and live editing

Just as for Persistent 2D positions, setting a label allows to modify the transform in live:

   show << M->("bunny");
by pressing t.

Here demonstration of the interpolation between two frames with different persistent transforms:

Builders

Transform Translation(const vec& x)

Transform AxisAngle(scalar th, vec x)

Transform Scale(const vec& x)

Transform Scale(scalar s)

Transform ScalePositionRotate(const vec& s,const vec& p,vec axis,scalar th)

Transform ScalePositionRotate(const vec& s,const vec& p,const mat& R)