Bones posed into place: each bone's own position and rotation relative to its parent, turned into a transform from the bone's space to the model's.
A transform is three rows {{r00, r01, r02, tx}, {r10, r11, r12, ty}, {r20, r21, r22, tz}}: a point p goes to {row0 · p + tx, row1 · p + ty, row2 · p + tz}.
parents = {-1, 0, 1}
locals = [{{0.0, 0.0, 0.0}, q0}, {{0.0, 0.0, 10.0}, q1}, {{0.0, 0.0, 10.0}, q2}]
transforms = Cauldron3D.Skeleton.pose(parents, locals)
Cauldron3D.Skeleton.apply(elem(transforms, 2), {0.0, 0.0, 0.0})A bone's parent comes before it; -1 marks a bone with none.
Summary
Functions
Point point moved by transform.
The transform doing inner and then outer.
The transform that changes nothing.
Where transform puts the origin.
Each bone's transform into the model's space, root applied to the bones without a parent.
Direction vector turned by transform, its move left out.
The transform of a rotation q followed by a move to position.
Types
Functions
@spec apply(transform(), Cauldron3D.Vec.t()) :: Cauldron3D.Vec.t()
Point point moved by transform.
The transform doing inner and then outer.
@spec identity() :: transform()
The transform that changes nothing.
@spec origin(transform()) :: Cauldron3D.Vec.t()
Where transform puts the origin.
@spec pose(tuple(), [{Cauldron3D.Vec.t(), Cauldron3D.Quat.t()}], transform()) :: tuple()
Each bone's transform into the model's space, root applied to the bones without a parent.
@spec rotate(transform(), Cauldron3D.Vec.t()) :: Cauldron3D.Vec.t()
Direction vector turned by transform, its move left out.
@spec transform(Cauldron3D.Vec.t(), Cauldron3D.Quat.t()) :: transform()
The transform of a rotation q followed by a move to position.