mikaxyz/elm-gltf/4.1.0

NOTE: the latest version is 5.0.0

Gltf.Animation

glTF supports articulated and skinned animation via key frame animations of nodes' transforms.

Types

type alias Animation =
Animation

A keyframe animation

= AnimatedBone
{ skinIndex : Int
, inverseBindMatrix : Mat4
, joint : Mat4
}

An animated bone used for skeletal/skinned animation

= AnimatedPositionProperty NodeIndex Vec3
| AnimatedRotationProperty NodeIndex Quaternion

The animated Transforms of a Node separated into TRS properties.

NOTE: Scale and weights are not supported at this point.

Get transformation of nodes/bones in a specific point of time

animatedProperties : Float -> List Animation -> List AnimatedProperty

With the Animations received from a Gltf.QueryResult this will give you AnimatedProperties to transform your nodes at a point in time.

animatedBoneTransforms : Float -> List Animation -> Skin -> List AnimatedBone

With the Animations received from a Gltf.QueryResult and a Skin this will give you AnimatedBones that can be used to deform a mesh at a point in time.

Get name

name : Animation -> Maybe String

The user-defined name of the animation