TAILIEUCHUNG - Character Animation with Direct3D- P14
Character Animation with Direct3D- P14:This book is primarily aimed at teaching indie and hobby game developers how to create character animation with Direct3D. Also, the seasoned professional game developer may find some interesting things in this book. You will need a solid understanding of the C++ programming language as well as general object-oriented programming skills. | 246 Character Animation with Direct3D Two-Joint Inverse Kinematics Now I ll show you how to attack the Two-Joint Reach IK problem. To solve this problem easier you must take the information you know about people in general and put it to good use. For example in games the elbow joint is treated like a hinge joint with only one degree of freedom 1-DoF while the shoulder joint is treated like a ball joint 3-DoF . The fact that you treat the elbow or knee joint as a hinge makes this a whole lot simpler. You know that the arm can be fully extended completely bent or something in between. So in other words you know that the angle between the upper and lower arm has to be between 0 and 180 degrees. This in turn makes it pretty easy for you to calculate the reach of an arm when you know the length of the upper and lower arm. Consider Figure for example. lease purchase PDF Split-Merge on to remove this watermark. Chapter 11 Inverse Kinematics 247 FIGURE Within an arm s reach The black line in Figure defines all the points that this arm can reach assuming that the elbow joint can bend from 0 to 180 degrees. Let s say that you re trying to make your character reach a certain point with his arm. Your first task is to figure out the angle of the elbow joint given the distance to the target. Using the Law of Cosines this becomes a pretty straightforward task since you know the length of all sides of the triangle. The formula for the Law of Cosines is C2 A2 B2 - 2ABcos x K OTf Trivia You might recognize part of the Law of Cosines as the Pythagorean Theorem. Actually the Pythagorean Theorem is a special case of the Law of Cosines where the angle x is 90 degrees. Since the cosine for 90 degrees is zero the term -2ABcos x can be removed. sase purchase PDF Split-Merge on to remove this watermark. 248 Character Animation with Direct3D FIGURE The Law of Cosines. Figure shows the Law of Cosines applied to the elbow problem. In .
đang nạp các trang xem trước