CMSC 425 : Lecture 9 Basics of Skeletal Animation and Kinematics

نویسنده

  • Roger Eastman
چکیده

ion Revisited: We have seen the use of homogeneous matrices before for the purpose of performing affine transformations (that is, for moving objects around in space). We are using the same mechanism here, but the meaning is quite different. Here the objects are not being moved, rather we are simply translating the names of points and vectors from one coordinate system to another. The geometric objects are themselves not moving. You might wonder, “What’s the difference in how you look at it?” Recall that in affine geometry we defined points and (free) vectors as different abstract objects, that employ the same representation (homogeneous vectors). Here, we are distinguishing two different types of operations (affine transformations versus change-of-coordinates transformations), but using the same representation (homogeneous matrices) for both. Even though the same representation is being used, these should be conceptualized as two very different operations. Joint Transformations: Returning to the problem of skeletal systems, let us assume that we are working in 3-dimensional space, and consider the skeleton in its bind pose. For any two joints j and k, define T[k←j] to be the change-of-coordinates transformation that maps a point in joint j’s coordinate system to its representation in k’s coordinate system. (At this point we are not considering joint rotations.) That is, if v is a column vector in homogeneous coordinates representing of a point relative to j’s coordinate system, then v′ = T[k←j] · v is exactly the same point in space, but it is expressed in coordinates relative to k’s coordinate frame. (In previous lectures I have used p for points and v for free vectors. Since we are using p for “parent”, I’ll refer to points by the letter v, but don’t be confused.) Given any non-root joint j, define the local-pose transformation, denoted T[p(j)←j], to be an affine transformation that converts a point in j’s coordinate frame to its representation in its parent’s (p(j)) coordinate frame. Define the inverse local-pose transformation, denoted T[j←p(j)], to be the inverse of this transformation. That is, it converts a point expressed relative to j’s parent’s frame back to j’s frame. (Recall that these transformations do not change the position of a point. They simply translate the same point from its representation in one frame to another.) (a) (b) i x y k x y v v[k] = (2, 0, 1) v[j] = (6, 0, 1) v[i] = (3, 6, 1) j x y Fig. 5: Three joints i, j, and k in a (rather nonstandard) bind pose. The point v is represented in homogeneous coordinates relative each frame. Consider three joints i, j, and k, where i = p(j) and j = p(k) (see Fig. 5(a)). The local-pose transformation for k, T[p(k)←k], can be expressed more succinctly as T[j←k]. Given a point v[k] Lecture 9 5 Spring 2018 CMSC 425 Dave Mount & Roger Eastman expressed relative to k’s frame, we can express it relative to j’s frame as v[j] = T[j←k] · v[k]. Similarly, a point v[j] expressed relative to j’s frame can be expressed relative to i’s frame as v[i] = T[i←j] · v[j]. Combining these, we can express a point in k’s frame relative to i’s frame by taking the product of these two matrices v[i] = T[i←j] · T[j←k] · v[k] = T[i←k] · v[k], where T[i←k] = T[i←j] · T[j←k]. Clearly, by multiplying appropriate chains of the local-pose transformations and their inverses, we can walk up and down the paths of the tree allowing us to convert a point relative to any one joint into its representation relative to any other joint. An Example: To make this a bit more concrete, let us consider an example in 2-dimensional space. Consider the pose shown in Fig. 5(a). (This is not a normal bind pose, since the elbow should not be bent, but it makes for a more interesting case.) Let i denote the shoulder joint, j the elbow joint, and k the hand joint. Consider a point v that lies two units beyond the model’s index finger. Its homogeneous coordinates relative to the hand frame are (2, 0, 1). (Since the x-axis points up.) Its coordinates relative to the elbow frame are (6, 0, 1), and its coordinates relative to the shoulder frame are (3, 6, 1) (see Fig. 5(b)). That is, v[k] =   2 0 1   v[j] =   6 0 1   v[i] =   3 6 1   . Because k’s coordinate frame lies 4 units along the x-axis relative to j’s coordinate frame, the local pose transformation T[j←k] (which maps a point in k’s coordinate frame to j’s coordinate frame) clearly increases the x-coordinate by 4 units. Thus: T[j←k] =   1 0 4 0 1 0 0 0 1   . We can easily check this, since T[j←k] · v[k] =   1 0 4 0 1 0 0 0 1   ·   2 0 1   =   6 0 1   = v[j], just as we expected. Next, consider how to map a point in j’s coordinate frame to its parent’s frame i. Observe that the y-coordinate of the transformed point (its vertical distance) is the x-coordinate of the original point. Thus, the middle row of the matrix is (1, 0, 0). The x-coordinate of the Lecture 9 6 Spring 2018 CMSC 425 Dave Mount & Roger Eastman new point (its distance to the right of the shoulder) is 3 minus the old y-coordinate. Thus, the first row of the matrix is (0,−1, 3). Therefore, the transformation that achieves this change of coordinates is T[i←j] =   0 −1 3 1 0 0 0 0 1   . Again, we can check this, since T[i←j] · v[j] =   0 −1 3 1 0 0 0 0 1   ·   6 0 1   =   3 6 1   = v[i], as we expected. Now, to obtain the transformation T[k←i], we multiply these two matrices (translating from k to j, then j to i) T[i←k] = T[i←j] · T[j←k] =   0 −1 3 1 0 0 0 0 1   ·   1 0 4 0 1 0 0 0 1   =   0 −1 3 1 0 4 0 0 1   Finally, to check this we have T[i←k] · v[k] =   0 −1 3 1 0 4 0 0 1   ·   2 0 1   =   3 6 1   = v[i]. Again, this is just what we expect to happen. Of course, applying this in 3-dimensional space will involve handling 4× 4 matrices and the associated rotation and translation matrices. While this would be much harder to do by hand, it can be done in by a similar process that is purely mechanical (and hence, easy to program). Forward Kinematics: Next, suppose that in addition to knowing the local-pose transformations and their inverses, we also know the rotation transformations associated with the individual joints of the system. Kinematics (also called forward kinematics) is the problem of determining where a point is transformed as a result of these rotations. We can apply our knowledge of rotation transformations and the local-pose transformations and their inverses to solve this problem. For example, recall the point v in our earlier example (see Fig. 6(a)) Suppose that the elbow is rotated by counterclockwise by 30◦ (see Fig. 6(b)), and then the shoulder is rotated clockwise by 45◦, that is, counterclockwise by −45◦ (see Fig. 6(c)). The question that we want to consider, where is the point v mapped to as a result of these two rotations? Let v′ be its position after the elbow rotation and let v′′ be its position after both rotations. Before getting to the answer, recall from our earlier lecture on affine geometry the rotation transformations in homogeneous coordinates: Rot(30◦) =   cos 30◦ − sin 30◦ 0 sin 30◦ cos 30◦ 0 0 0 1   =   √ 3/2 −1/2 0 1/2 √ 3/2 0 0 0 1   . Lecture 9 7 Spring 2018 CMSC 425 Dave Mount & Roger Eastman

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Mount CMSC 425 : Lecture 9 Basics of Skeletal Animation and Kinematics

Game Animation: Most computer games involve characters that move around in a fluid and continuous manner. Unlike objects that move according to the basic laws of physics (e.g., balls, projectiles, vehicles, water, smoke), the animation of skeletal structures may be subject to many complex issues, such as physiological constraints (e.g., how to jump onto a platform), athletic technique (e.g., ho...

متن کامل

Cmsc 425: Lecture 10 Skeletal Animation and Skinning

Recap: Last time we introduced the principal elements of skeletal models and discussed forward kinematics. Recall that a skeletal model consists of a collection of joints, which have been joined into a rooted tree structure. Each joint of the skeleton is associated with a coordinate frame which specifies its position and orientation in space. Each joint can be rotated (subject to sum constraint...

متن کامل

CMSC 425 : Lecture 10 Skeletal Animation and Skinning Tuesday , Mar 14 , 2017

Recap: Last time we introduced the principal elements of skeletal models and discussed forward kinematics. Recall that a skeletal model consists of a collection of joints, which have been joined into a rooted tree structure. Each joint of the skeleton is associated with a coordinate frame which specifies its position and orientation in space. Each joint can be rotated (subject to sum constraint...

متن کامل

CMSC 425 : Lecture 13 Animation for Games : Basics Tuesday , Mar 26 , 2013

Game Animation: Most computer games revolve around characters that move around in a fluid and continuous manner. Unlike objects that move according to the basic laws of physics (e.g., balls, projectiles, vehicles, water, smoke), the animation of skeletal structures may be subject to many complex issues, such as physiological constraints (how to jump onto a platform), athletic technique (how a b...

متن کامل

CMSC 425 Game Programming

1 Copyright, David M. Mount, 2016, Dept. of Computer Science, University of Maryland, College Park, MD, 20742. These lecture notes were prepared by David Mount for the course CMSC 425, Game Programming, at the University of Maryland. Permission to use, copy, modify, and distribute these notes for educational purposes and without fee is hereby granted, provided that this copyright notice appear ...

متن کامل

CMSC 425 Game Programming 1

1Copyright, David M. Mount, 2013, Dept. of Computer Science, University of Maryland, College Park, MD, 20742. These lecture notes were prepared by David Mount for the course CMSC 425, Game Programming, at the University of Maryland. Permission to use, copy, modify, and distribute these notes for educational purposes and without fee is hereby granted, provided that this copyright notice appear i...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2018