6/16/2023 0 Comments Cacani animation bonesOnce we have a matrix for each bone, we can draw some visual representation of the skeleton structure in its current position. For each bone we send in the current matrix, add to it the bone's rotation, store as BoneMatrix for that bone, then translate by length. The bone matrices are computed by starting with main bone and recursively processing each child bone in the same manner. This matrix could be added to the Bone Structure above, but I can have multiple objects with separate animations that are instances of a single skeleton, so I prefer to keep it in an array of size numBones that is part of each skeleton object. Once we have set the values of current keyframe, we use this keyframe to calculate a matrix for each bone. Spherical Linear Interpolation (Slerp) can be used for quaternions, and a linear average or hermite curves for the location vector. I also include location and velocity (for IK & offset control,) as well as a few other elements.įor the actual animating, we start with setting the proper values for the current frame by interpolating between the left and right keyframe. At their simplest, a keyframe need only include a quaternion for rotation and its frame number. You'll want a separate structure for Bone keyframes.
0 Comments
Leave a Reply. |