Free JavaScript Editor Ajax Editor

↑

Main Page

## Simple KinematicsThe term kinematics means a lot of things. To a 3D artist it means one thing, to the 3D game programmer it means another, and to a physicist it means yet another. However, in this section of the book it means the mechanics of moving linked chains of rigid bodies. In computer animation there are two kinematic problems. The first is called forward kinematics and the second is inverse kinematics. The forward kinematic problem is shown in Figure 13.38; here you see a 2D serially linked chain of rigid bodies (straight arms). Each joint can freely rotate in the plane, thus there are 2 degrees of freedom in this example, q ## Figure 13.38. The forward kinematic problem.Given q Why are we interested in this? Well, if you are going to write a 2D or 3D game and want to have real-time models that have links that move around, then you better know how to do this. For example, 3D animation is accomplished in two ways. The quick and dirty method is to have a set of meshes that represent the 3D animation of an object. The more flexible method is to have a single 3D mesh that has a number of joints and arms and then to "play" motion data through the 3D model. However, to do this you must understand the physics/mechanics of how to move a hand in relation to the wrist, in relation to the elbow, in relation to the shoulder, in relation to the hips, and so forth—see the problem? The second kinematic problem is the converse of the first: Given the position of p ## Figure 13.39. The inverse kinematic problem.Referring to the figure, you see that there are two possible solutions that satisfy all the constraints. I'm not going to tackle this problem in general since in most cases we never need to solve it, and the math is gnarly, but I will give an example later in the section of how to go about it. ## Solving the Forward Kinematic ProblemWhat I want to do is show you how to solve the forward kinematic problem because it's almost trivial. Referring back to Figure 13.38, the problem is nothing more than relative motions. If you look at the problem from joint 2, then locating p Forget about the first arm and just focus on the second, that is, let's work our way backward. The starting point is p p But we don't have p |1 0 0| | cos Therefore, p |1 0 0| | cos Okay, if we can compute p p where p With all that in mind, we see that the point p p for n links. This works because each matrix multiplication pair T*R transforms the coordinate system relative to the link, hence, the products of these transforms is like a sequence of changing coordinate systems that you can use to locate the end point. As an example, let's see if this mumbo jumbo works. Figure 13.40 depicts a carefully worked out version of the problem on graph paper. ## Figure 13.40. A kinematic chain worked out on paper.I have labeled the points, angles, and so on, and using a compass and ruler computed the position of p l I roughly estimate from the figure that p Now, let's see if the math gives us the same answer. |1 0 0| | 0 1 0| |1 0 0| | .707 .707 0| p Discarding the 1.0 since [x,y,1] really means, x' = x/1, y'=y/1, or x'=x, y'=y, we have: p If you look at Figure 13.40, it looks pretty close! That's all there is to forward kinematics in 2D. Of course, doing it in 3D is a bit more complex due to the z-axis, but as long as you pick a rotation convention then it all works out. I created ## Figure 13.41. The kinematic chain demo.## Solving the Inverse Kinematic ProblemSolving inverse kinematics is rather complex in general, but I want to give you a taste of it so you can at least know where to start. The previous section solved for p As an example, let's try a simpler problem with only one link, so you can see the process. Figure 13.42 shows one link l ## Figure 13.42. A single link inverse kinematic problem.We can use the forward kinematic matrices to solve the problem like this: p Therefore, x or, q MATH I could have kept the entire problem in matrix form, but this is more illustrative. Okay, this system is overdetermined; in other words, once you select x or y then the other is determined via q x If this had two links, then you would see that for any x,y there would be more than one solution set q |

↓ Bitcoin Dice - Crypto Casino

Ajax Editor JavaScript Editor