Unverified Commit 8e3f3f9f authored by Hesper Yin's avatar Hesper Yin Committed by GitHub
Browse files

Update skeleton_kinematics.md

parent d3433abc
......@@ -8,15 +8,15 @@ permalink: /animation/skeleton_kinematics
A `Skeleton`(defined in `scene/skeleton.h`) is what we use to drive our animation. You can think of them like the set of bones we have in our own bodies and joints that connect these bones. For convenience, we have merged the bones and joints into the `Joint` class which holds the orientation of the joint relative to its parent as euler angle in its `pose`, and `extent` representing the direction and length of the bone with respect to its parent `Joint`. Each `Mesh` has an associated `Skeleton` class which holds a rooted tree of `Joint`s, where each `Joint` can have an arbitrary number of children.
All of our joints are ball `Joint`s which have a set of 3 rotations around the [[task2_media/0027.png|height=9px]], [[task2_media/0028.png|height=12px]], and [[task2_media/0029.png|height=9px]] axes, called _Euler angles_. Whenever you deal with angles in this way, a fixed order of operations must be enforced, otherwise the same set of angles will not represent the same rotation. In order to get the full rotational transformation matrix, [[task2_media/0030.png|height=14px]], we can create individual rotation matrices around the [[task2_media/0031.png|height=14px]], [[task2_media/0032.png|height=14px]], and [[task2_media/0033.png|height=14px]] axes, which we call [[task2_media/0034.png|height=16px]], [[task2_media/0035.png|height=18px]], and [[task2_media/0036.png|height=16px]] respectively. The particular order of operations that we adopted for this assignment is that [[task2_media/0037.png|height=18px]].
All of our joints are ball `Joint`s which have a set of 3 rotations around the <img src=task2_media/0027.png height="20">, <img src=task2_media/0028.png height="20">, and <img src=task2_media/0029.png height="20"> axes, called _Euler angles_. Whenever you deal with angles in this way, a fixed order of operations must be enforced, otherwise the same set of angles will not represent the same rotation. In order to get the full rotational transformation matrix, <img src=task2_media/0030.png height="20">, we can create individual rotation matrices around the<img src=task2_media/0031.png height="20">, <img src=task2_media/0032.png height="20">, and <img src=task2_media/0033.png height="20"> axes, which we call <img src=task2_media/0034.png height="20">, <img src=task2_media/0035.png height="20">, and <img src=task2_media/0036.png height="20"> respectively. The particular order of operations that we adopted for this assignment is that <img src=task2_media/0037.png height="20">.
### Forward Kinematics
_Note: These diagrams are in 2D for visual clarity, but we will work with a 3D kinematic skeleton._
When a joint's parent is rotated, that transformation should be propagated down to all of its children. In the diagram below, [[task2_media/0038.png|height=12px]] is the parent of [[task2_media/0039.png|height=12px]] and [[task2_media/0040.png|height=12px]] is the parent of [[task2_media/0041.png|height=12px]]. When a translation of [[task2_media/0042.png|height=12px]] and rotation of [[task2_media/0043.png|height=16px]] is applied to [[task2_media/0044.png|height=12px]], all of the descendants are affected by this transformation as well. Then, [[task2_media/0045.png|height=12px]] is rotated by [[task2_media/0046.png|height=16px]] which affects itself and [[task2_media/0047.png|height=12px]]. Finally, when rotation of [[task2_media/0048.png|height=16px]] is applied to [[task2_media/0049.png|height=12px]], it only affects itself because it has no children.
When a joint's parent is rotated, that transformation should be propagated down to all of its children. In the diagram below, <img src=task2_media/0038.png height="20"> is the parent of <img src=task2_media/0039.png height="20"> and <img src=task2_media/0040.png height="20"> is the parent of <img src=task2_media/0041.png height="20">. When a translation of <img src=task2_media/0042.png height="20"> and rotation of <img src=task2_media/0043.png height="20"> is applied to <img src=task2_media/0044.png height="20">, all of the descendants are affected by this transformation as well. Then, <img src=task2_media/0045.png height="20"> is rotated by <img src=task2_media/0046.png height="20"> which affects itself and <img src=task2_media/0047.png height="20">. Finally, when rotation of <img src=task2_media/0048.png height="20"> is applied to <img src=task2_media/0049.png height="20">, it only affects itself because it has no children.
[[media/forward_kinematic_diagram.jpg]]
<img src=task2_media/forward_kinematic_diagram.jpg>
You need to implement these routines in `student/skeleton.cpp` for forward kinematics.
......@@ -102,4 +102,4 @@ A key thing for this part is to _remember what coordinate frame you're in_, beca
Once you have IK implemented, you should be able to create a series of joints, and get a particular joint to move to the desired final position you have selected.
[[media/ik.gif]]
-->
\ No newline at end of file
-->
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment