青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當(dāng)自強(qiáng)而不息

Using Key?Framed Skeletal Animation(1)

Using Key−Framed Skeletal Animation Sets

If you have explored the DirectX SDK samples, you might have come across a little demo called SkinnedMesh, which shows you how to use a pre−calculated key−frame animation stored in an .X file to animate an on−screen character. The problem is, that sample's code is so convoluted and hard to understand that it'll make your head spin. With no real documentation of how to use .X file animation data, the skinned mesh animation sample remains full of mystery.

You have saw how to work with skeletal−based meshes, called skinned meshes, which adhere to an underlying hierarchy of bones (a skeletal structure). The vertices of the skinned mesh are attached to those bones, and they move as the bones do. Basically, animation is achieved by slowly applying a set of transformations to the hierarchy of bones and letting the vertices follow along with the movements.

The sequence of these animation transformations is called a key frame. You use key frames to define both the transformation and the time of the transformation to use in the animation sequence. Where do you get the transformations you use to apply the movements to those bones? There are many file formats at your disposal, but to keep on the DirectX route, I'll be concentrating on using .X files.

If you take a look at the SkinnedMesh demo's .X file (Tiny.x) from the DirectX SDK, you'll notice that along with the typical Frame and Mesh templates, there is an AnimationSet template with a number of embedded Animation and AnimationKey objects. It's from these animation data objects that you obtain the transformations used to animate your skinned mesh's bone hierarchy. Take a closer look at some of these animation objects within an .X file to see what I mean.

AnimationSet Walk {
	Animation {
{Bip01}
		AnimationKey {
4;
3;
0; 16; 1.00000, 0.00000, 0.00000, 0.00000,
0.00000, 1.00000, 0.00000, 0.00000,
0.00000, 0.00000, 1.00000, 0.00000,
0.00000, 0.00000, 0.00000, 1.00000;;,
1000; 16; 1.00000, 0.00000, 0.00000, 0.00000,
0.00000, 1.00000, 0.00000, 0.00000,
0.00000, 0.00000, 1.00000, 0.00000,
0.00000, 0.00000, 0.00000, 1.00000;;,
2000; 16; 1.00000, 0.00000, 0.00000, 0.00000,
0.00000, 1.00000, 0.00000, 0.00000,
0.00000, 0.00000, 1.00000, 0.00000,
0.00000, 0.00000, 0.00000, 1.00000;;;
}
	}
	Animation {
{Bip01_LeftArm}
		AnimationKey {
0;
1;
0; 4; 1.00000, 0.000000, 0.00000, 0.000000;;;
}
		AnimationKey {
1;
1;
0; 4; 1.000000, 1.00000, 1.000000;;;
}
		AnimationKey {
2;
1;
0; 3; 0.000000, 0.00000, 0.000000;;;
}
}

}

What you're looking at is a simple animation that works with two bones. Each animation is defined inside an AnimationSet data object; in the previous instance, this animation has been assigned the name Walk. Two Animation objects that contain the various keys of animation for each bone are embedded in this AnimationSet object. Keys?! What the heck am I talking about? Well, my friend, let me take a moment to explain the concept of keys in animation.

 

Using Keys in Animation

A key, short for an animation key, is a timeline marker that signifies a change in a bone's position and/or orientation. An animation that uses keys is called a key−framed animation. The reasons for using keys are quite significant, with the most important one being memory conservation.

You see, an animation is a series of movements (bone movements, in this case) over a set period of time. During this animation, your bone hierarchy is modified to convey the motion in the animation. Trying to store every bone's position and orientation for every millisecond of animation is impossible; there's just too much data to store it effectively. Instead, you can space out the movements over a longer period of time (every second or two)or better yet, whenever a major change in each bone's position or orientation takes place. For example, imagine your armrather, imagine the arm illustrated in Figure 5.1 .

The bones that construct the arm in Figure 5.1 are pointing straight out at the start of the animation. Over time, the bones bend at the imaginary elbow, come to a rest, and then bend at a different angle. So there are three major changes in the bones' orientationstraight (the default position), slightly bent, and a major bend in the joint. These three changes are the three keys in the animation.

Now, instead of storing the orientation of the bones every millisecond, store those three keys and the exact time (in milliseconds) that the bones would reach the appropriate orientation. In this example, suppose the arm animation starts at 0 milliseconds, reaches the first key (half−bent) at 500 milliseconds, and reaches the last key (fully bent) at 1,200 milliseconds.

Here's where using key frames comes in handy. Suppose you want to calculate the orientation of the bones at a specific timesay, at 648 milliseconds. That time just so happens to fall between the second and third keys (148 milliseconds past the second key). Now, assume that the two transformation matrices represent the orientations of each bone in the animation.

D3DXMATRIX matKey1, matKey2;

By taking each key and interpolating the values between them, you can come up with a transformation to use at any time between the keys. In this example, at 648 milliseconds in the animation, you can interpolate the transformations as follows:

// Get the difference in the matrices
D3DXMATRIX matTransformation = matKey2 − MatKey1;

// Get keys' times
float Key1Time = 500.0f;
float Key2Time = 1200.0f;

// Get the time difference of the keys
float TimeDiff = Key2Time − Key1Time;

// Get the scalar from animation time and time difference
float Scalar = (648.0f − Key1Time) / TimeDiff;

// Calculate the interpolated transformation matrix
matTransformation *= Scalar;
matTransformation += matKey1;

And there you have it! The matTransformation matrix now holds the interpolated transformation that you would apply to the bone in question to perfectly synchronize it to the animation! To increase precision, you can use translation, rotation, and scaling values instead of transformation matrices during the interpolation. I'll get back to doing just that in a bit, but for now let's get back to the Animation template with which you'll be dealing.

For every bone in your hierarchy, there should be a matching Animation object. Immediately following the Animation object declaration, you'll see a referenced data object name. This is the name of the bone that has its animation data defined using the preceding AnimationKey objects. This means that in the previous example, the two bones, Bip01 and Bip01_LeftArm, are being animated.

One or more AnimationKey objects follow the data object reference. The AnimationKey objects define the keys of the animation a bone uses, which can include translation, rotation, scale, or transformation keys. Take a closer look at each key type and how you store its information in the objects.


posted on 2008-04-24 18:13 lovedday 閱讀(588) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


公告

導(dǎo)航

統(tǒng)計(jì)

常用鏈接

隨筆分類(lèi)(178)

3D游戲編程相關(guān)鏈接

搜索

最新評(píng)論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲一级黄色| 欧美一区二区视频网站| 老司机免费视频一区二区| 亚洲天堂黄色| 国产精品xnxxcom| 亚洲午夜影视影院在线观看| 亚洲精品五月天| 欧美日韩午夜视频在线观看| 亚洲一区二区三区乱码aⅴ蜜桃女| 亚洲国产女人aaa毛片在线| 女女同性精品视频| 日韩性生活视频| 99国产精品99久久久久久粉嫩| 欧美视频在线一区二区三区| 午夜精品福利视频| 久久国产精品99久久久久久老狼| 激情视频一区| 亚洲精品一区二区三区樱花 | 免播放器亚洲一区| 狂野欧美激情性xxxx| 一本色道久久综合狠狠躁的推荐| 一本久久精品一区二区| 国产伦精品一区| 免费欧美日韩国产三级电影| 欧美日韩1区2区3区| 先锋影音久久久| 欧美69wwwcom| 亚洲欧美日韩在线播放| 久久精品国产精品亚洲| 日韩一级大片| 久久av红桃一区二区小说| 亚洲日本无吗高清不卡| 亚洲影院在线观看| 亚洲人成人一区二区在线观看| 亚洲制服少妇| 999在线观看精品免费不卡网站| 亚洲一级影院| 99精品国产一区二区青青牛奶| 亚洲伊人一本大道中文字幕| 亚洲精品欧洲| 久久久国产亚洲精品| 中日韩高清电影网| 久久亚洲午夜电影| 欧美在线观看天堂一区二区三区| 欧美va天堂在线| 久久九九精品| 国产精品久久久久国产a级| 欧美成人免费小视频| 国产精品日韩二区| 亚洲久色影视| 亚洲国产精品一区二区第一页 | 亚洲综合日韩在线| 亚洲美女在线国产| 久久全国免费视频| 欧美一级久久久| 欧美日韩在线一区| 亚洲国产精品视频| 亚洲国产高潮在线观看| 性色av香蕉一区二区| 亚洲一区中文| 欧美视频不卡中文| 一区二区三区国产| 日韩午夜电影av| 欧美α欧美αv大片| 玖玖玖国产精品| 精品不卡一区| 久久久久天天天天| 老鸭窝91久久精品色噜噜导演| 国产欧美一区二区三区久久| 亚洲视频在线免费观看| 亚洲午夜影视影院在线观看| 欧美日韩一二三区| 一区二区欧美国产| 亚洲男人av电影| 国产伦精品一区二区三区视频黑人| 9人人澡人人爽人人精品| 99国产精品国产精品久久| 欧美另类在线观看| 亚洲美女性视频| 亚洲男同1069视频| 国产欧美一区二区精品性色| 欧美一区二区三区喷汁尤物| 久久久精品日韩| 亚洲国产一区二区三区高清| 欧美大片91| av成人激情| 欧美一区二区播放| 尤物yw午夜国产精品视频明星| 久久久久9999亚洲精品| 欧美激情久久久| 亚洲一区精品视频| 国产日韩一区在线| 久久中文字幕一区| 亚洲精品免费一区二区三区| 亚洲一区二区三区午夜| 国产日本欧美视频| 久久在线精品| 一区二区高清在线观看| 久久精品2019中文字幕| 亚洲高清在线观看一区| 欧美午夜一区二区福利视频| 亚洲欧美日韩在线观看a三区| 欧美/亚洲一区| 亚洲伊人色欲综合网| 国产一区二区毛片| 欧美福利精品| 欧美一站二站| 亚洲精品久久久蜜桃| 欧美专区亚洲专区| 日韩亚洲国产精品| 国产一区在线播放| 欧美日韩一级黄| 久久久噜噜噜久久人人看| 中文高清一区| 亚洲成人在线视频播放 | 香蕉久久久久久久av网站| 亚洲国产精品福利| 久久九九国产精品| 亚洲天堂av综合网| 在线看视频不卡| 国产精品入口66mio| 欧美剧在线观看| 久久人人97超碰国产公开结果| 亚洲午夜激情免费视频| 亚洲国产成人精品女人久久久| 欧美一区二区三区在线| 一区二区日韩精品| 亚洲三级免费电影| 激情一区二区三区| 国产亚洲精品bt天堂精选| 欧美黄色视屏| 久久频这里精品99香蕉| 欧美有码在线视频| 亚洲欧美一区二区原创| 9i看片成人免费高清| 亚洲欧洲精品一区二区| 欧美成人一区二区三区| 久久乐国产精品| 久久精品一本久久99精品| 亚洲欧美久久| 亚洲综合久久久久| 亚洲天堂激情| 夜夜爽www精品| 一本到12不卡视频在线dvd| 亚洲电影免费观看高清| 国内精品伊人久久久久av一坑| 国产精品亚洲一区| 欧美网站在线观看| 欧美视频在线观看免费| 欧美日韩视频在线观看一区二区三区| 久久人人爽国产| 久久久久国色av免费看影院 | 亚洲第一黄色| 亚洲国产99精品国自产| 亚洲丰满少妇videoshd| 欧美顶级艳妇交换群宴| 欧美成人一区二区三区片免费| 欧美成人中文字幕在线| 欧美国产一区二区在线观看| 欧美第十八页| 亚洲黄色三级| 一区二区三区免费网站| 亚洲一品av免费观看| 欧美亚洲日本国产| 久久精品天堂| 你懂的视频欧美| 欧美日韩情趣电影| 国产伦精品一区二区三区视频孕妇 | 亚洲精品乱码久久久久久黑人 | 性欧美暴力猛交另类hd| 久久久久久久一区二区三区| 老司机aⅴ在线精品导航| 亚洲电影免费在线| 99精品国产热久久91蜜凸| 在线视频中文亚洲| 久久精品99| 欧美日本一区二区视频在线观看| 国产精品久久久久久久久婷婷| 国产午夜精品久久久| 亚洲国产日韩欧美一区二区三区| 亚洲精品久久久一区二区三区| 亚洲午夜性刺激影院| 久久久久久久久久久成人| 亚洲第一狼人社区| 亚洲伊人一本大道中文字幕| 久久久久久久综合| 欧美三区美女| 亚洲国产高清高潮精品美女| 亚洲亚洲精品三区日韩精品在线视频| 欧美专区亚洲专区| 亚洲日本免费电影| 久久精品中文字幕一区二区三区| 欧美国产日韩一区| 国产欧美精品在线| 一道本一区二区| 美脚丝袜一区二区三区在线观看| 日韩视频永久免费| 久久免费国产精品| 国产精品一区二区黑丝| 日韩视频不卡中文|