xtanion's Blog

Week 13 - Multi-bone skeletal animation support

xtanion
Published: 09/20/2022

What did you do this week?

This week I fixed all the issues with skeletal animations, and we got to see our first render of skeletal animation :).

  • Implemented a hierarchical timeline system (i.e., one timeline for each bone, and the timeline will contain its parent timeline in a hierarchy).

- I figured out that we don't need to apply the parent transform as we're applying it to the vertex data while forming the actor. So the skin matrix becomes SkinMatrix = InverseBindPose * BoneDeform where BoneDeform = CurrentBoneTransform * ParentBonetransform.

Here's a preview using the CesiumMan model:

What is coming up next week?

  • Add tests for simple animation PR #643.
  • Multiple actor support for skeletal animation.
  • Take a look at Morphing.

Did you get stuck anywhere?

  • No, I didn't get stuck this week.
View Blog Post

Week 12 - Adding skeleton as actors and fix global transformation

xtanion
Published: 09/20/2022

What did you do this week?

  • I started this week by fixing the segmentation fault for the skinning test. I could not fix this as of now.
  • I imported the RiggedFigure model into the Blender and I was quite impressed with how it visualizes each bone. So, I created a function that creates an arrow actor in place of a bone, and by applying the correct transformation, we get the bones of a model in place. Here's a quick preview of bones in Blender vs bones in FURY:

image

image

  • After having the bones actor, I noticed that some bones are not aligned correctly. It was happening due to multiplication of the same transformation matrix twice.
  • I also created a function that calculates the total transformation of a node, it eliminates the need to use timeline.get_value in get_skin_timeline function.

What is coming up next week?

  • It seems like I fixed everything, but we are not getting the correct model at timestamp 0. We need to find the cause and fix it!
  • Cleaning the Simple Animation PR #643, and merging it.

Did you get stuck anywhere?

  • While applying the timeline, we were getting the identity matrix for timestamp 0.0s, it was set to a new value before. We figured this in our meeting that it's happening due to some model's animation not starting from 0.0s.

image

View Blog Post

Week 11 - Multiple transformations support and adding tests

xtanion
Published: 09/20/2022

What did you do this week?

As decided last week, I added support for multiple animations at the same timestamp. But this didn't solve the animation problems of RiggedSimple model.

  • I figured out that I was not applying the global transform of joints in the skinning matrix causing the joints to move to a new position. I referred to this answer by irradicator.

  • We had to invert the multiplication order (ie, np.dot(skin_mat, vertex) instead of np.dot(vertex, skin_mat)) for this model. We still need to figure out from where we get the multiplication order of the two.

    <iframe height="390" src="https://user-images.githubusercontent.com/74976752/187798821-7306cb13-dfc8-477c-8f86-1f5a6181f08a.mp4" width="600"></iframe>
  • I also tried to create a custom Interpolator that does all calculations required for vertex skinning. However, we couldn't get this working. I got a few suggestions from Mohamed in our meeting, I'll try to implement those.

  • Added tests for animations.

What is coming up next week?

  • Adding more tests.
  • Fixing the Interpolator.
  • Order of multiplication in the skinning matrix.

Did you get stuck anywhere?

No, I didn't get stuck this week.

View Blog Post

Week 10 - Multi-node skinning support

xtanion
Published: 09/01/2022

What did you do this week?

As we figured out that the SimpleSkin model is not animated as intended. This week I started working with that model; I figured out that we need to apply the InverseBindMatrix to each timer callback. I had a hard time figuring out what inverse bind matrix actually does. Here's a good blog that answers that.

In short: The InverseBindMatrix "undoes" any transformation that has already been applied to your model in its bind pose. Note: Inverse bind matrix shouldn't be applied with weights.

  • I got the SimpleSkin model to work perfectly. Here's a preview:

  • Support for multiple transformations is still missing. However RiggedSimple is also working fine, except that It doesn't interpolate translation and scaling matrices.

What is coming up next week?

  • Adding tests and adding support for combining transformation matrices for the same timestamp.
  • Write an Interpolator that applies skinning to the mesh internally.

Did you get stuck anywhere?

No, I didn't get stuck this week.

View Blog Post

Week 9 - First working skeletal animation prototype

xtanion
Published: 08/24/2022

What did you do this week?

  • This week I had the first working example of skeletal animation ready. I was able to render the SimpleSkin model. Here's a quick preview:

    <iframe height="390" src="https://user-images.githubusercontent.com/74976752/184981715-a83a8a36-f2bf-4ff1-9366-0c302dcf3f9b.mp4" width="600"></iframe>
  • I wrote a custom interpolator (just like the tangent cubic spline interpolator) for interpolating two transformation matrices.

What is coming up next week?

  • Generalising the skinning code to work with other models as well (it supports only the SimpleSkin model as of now).
  • Creating a custom interpolator to interpolate more than 4 matrices at once.

Did you get stuck anywhere?

No, I didn't get stuck this week.

View Blog Post