This topic is now archived and is closed to further replies.


Avatar Bones

Recommended Posts

Psybr    122
I want to create a third-person action game where the avatar is a stick figure. I want to make each line (lower arm, upper arm, etc) easily movable, i.e. make a call to lowerArm::turn(90 degrees). I''ve been thinking about it, and it seems that the only way to do this is for each part of the body to get the matrix of the part it''s connected to, and then update itself. You know what I mean?

Share this post

Link to post
Share on other sites
shurcool    439
umm... no, sorry.

maybe the 3 maths i'm taking next year (grade 12) will teach me. :%

edit: to make this post at least remotely useful, u might want to check out stuff on skeletal animation...


[edited by - shurcooL on July 6, 2003 4:55:29 PM]

Share this post

Link to post
Share on other sites
S1CA    1418
Each bone should store its transformation matrix LOCAL to its parent (i.e. in "parent space").

Consider all transforms local (i.e. rotate 90 degrees relative to parent), then each time you come to render the whole character, you start at the root bone (whose matrix is in world space) and walk down the tree doing a matrix multiply by its parent (i.e. collapse/flatten the whole tree into world space).

The information about the parent isn''t really needed until you need to render the thing as a whole or need to do stuff like IK.

You can also have a "dirty" flag for each bone to mark whether it''s been moved recently or not, each time you collapse the whole tree, you store the concatenated world version of each matrix with the bone as well as its local matrix, this lets you reduce the work since only children of dirty bones need to be updated and you can use the world space position as your frame of reference.

That''s roughly the way most people do it if the animation of the bones isn''t totally precanned.

Share this post

Link to post
Share on other sites