SI460 Graphics Forward Kinematics Concepts v2 We will explore some basic Linear Algebra constructions that allow us to work in multiple frames of reference on a model, and which enable Forward Kinematics. In graphics, we use multiple frames of reference to simplify transform calculations. We call these “spaces”. We choose whatever frame of reference is convenient for a given problem. If you see are tracking a moving car from a UAV, the car is best described with “world space” coordinates: latitude, longitude, and compass heading. If two people are sitting in the car, they would probably communicate to each other in “car space” – referencing the front, back, left and right of the car. We use transform matrices to translate coordinates between frames of reference. In this example we will use a model of a leg armature. The leg has two bones: Legbone and Footbone. There are three vertices (A, B, C) that define the ends of the bones. We can describe this armature as a series of five transforms that position the vertices in world space. There are four spaces in this model the we are interested in. A ‘space’ defines an origin and the direction of the X&Y axes. Creature space (Translate only) Legbone space (Rotation only) Footbone space (Translation & Rotation) Creature sp ->world sp 1 0 1 �0 1 7� 0 0 1 Legbone sp->Creature sp 0 1 0 �−1 0 0� 0 0 1 Legbone sp ->Footbone sp 0 −1 0 1 0 5 0 −1 5 �0 1 0� ∗ �1 0 0� = �1 0 0� 0 0 1 0 0 1 0 0 1 Some assumptions: • Each bone is straight, and extends only along the x-axis in its own local space. • The ‘root’ node of each child bone is parented to the ‘end’ node of the parent bone. The Legbone drawn in its local space. (0,0)->(5,0) Space Creature space Legbone space Footbone The Footbone drawn in its local space . (0,0)->(2,0) Transform to world space (Multiply a point in the space to the left by this transform to move it into world space) 1 0 1 � 0 1 7� 0 0 1 1 0 1 0 1 0 0 1 1 �0 1 7� ∗ �−1 0 0� = �−1 0 7� 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 0 −1 5 �−1 0 7� ∗ �1 0 0� = �0 1 2� 0 0 1 0 0 1 0 0 1 Let’s check our math using the Footbone->world space transform on our two Footbone vertices: 1 0 1 0 1 1 0 1 2 3 �0 1 2� ∗ �0� = �2� 𝐹𝑜𝑜𝑡𝑏𝑜𝑛𝑒 𝑟𝑜𝑜𝑡 √ �0 1 2� ∗ �0� = �2� 𝐹𝑜𝑜𝑡𝑏𝑜𝑛𝑒 𝑒𝑛𝑑 √ 0 0 1 1 1 0 0 1 1 1 Important: We enable FK by modifying one of the transforms above and multiplying the new matrix through the chain. e.g. Let’s rotate the Footbone root joint 30 degrees ccw from its current orientation: 1 0 1 . 866 −.5 0 . 866 −.5 1 Footbone root space ∗ � .5 �0 1 2� � .5 . 866 0� = . 866 2� (+30 deg ccw rotate) 0 0 1 0 0 1 0 0 1 -> world space Footbone transform * 30 deg ccw rotate = new Footbone transform Let’s check our math using the new Footbone->world space transform on our two Footbone vertices: 0 1 2 2.7 . 866 −.5 1 . 866 −.5 1 � .5 . 866 2� ∗ �0� = �2� 𝐹𝑜𝑜𝑡𝑏𝑜𝑛𝑒 𝑟𝑜𝑜𝑡 √ � . 5 . 866 2� ∗ �0� = � 3 � 𝐹𝑜𝑜𝑡𝑏𝑜𝑛𝑒 𝑒𝑛𝑑 √ 1 1 1 1 0 0 1 0 0 1