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

天行健 君子當自強而不息

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 閱讀(575) 評論(0)  編輯 收藏 引用

公告

導航

統(tǒng)計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲国产天堂久久综合网| 一区二区高清| 午夜精彩视频在线观看不卡| 国产精品日本| 久久精品亚洲一区二区三区浴池| 亚洲制服av| 一区二区三区在线免费观看| 亚洲大片免费看| 欧美成人在线网站| 亚洲一区在线免费观看| 午夜亚洲福利| 亚洲国产婷婷| 中文精品一区二区三区| 国产一区二区毛片| 欧美激情视频一区二区三区不卡| 欧美电影在线播放| 午夜亚洲福利| 巨乳诱惑日韩免费av| 一级日韩一区在线观看| 亚洲欧美精品在线观看| 亚洲国产欧美不卡在线观看| 最新日韩av| 国产午夜精品视频| 亚洲精品黄网在线观看| 国产一区二区中文| 亚洲精品男同| 悠悠资源网久久精品| 一区二区高清视频| 亚洲黄色高清| 欧美亚洲专区| 这里只有精品视频在线| 久久久久久夜精品精品免费| 亚洲视频一区二区免费在线观看| 久久国产精品久久久久久| 一本色道久久综合亚洲91| 欧美主播一区二区三区| 亚洲午夜av在线| 欧美成人中文字幕| 久久只精品国产| 国产精品视频第一区| 亚洲国产欧美久久| 国内偷自视频区视频综合| 国产精品99久久久久久宅男| 亚洲国产mv| 欧美在线一级视频| 欧美在线电影| 国产精品久久久久毛片大屁完整版| 亚洲高清自拍| 在线精品国产成人综合| 性久久久久久久久| 亚洲欧美日韩国产成人精品影院| 欧美黄色一级视频| 欧美va亚洲va国产综合| 国内精品国产成人| 欧美诱惑福利视频| 欧美自拍偷拍| 国产无遮挡一区二区三区毛片日本| 日韩一级裸体免费视频| 日韩视频亚洲视频| 欧美国产亚洲精品久久久8v| 欧美韩日一区二区| 亚洲大胆人体视频| 久久久久国产精品麻豆ai换脸| 欧美在线二区| 国产在线观看91精品一区| 西瓜成人精品人成网站| 欧美在线观看你懂的| 国产日韩欧美在线视频观看| 亚洲网站视频福利| 欧美亚洲三级| 国产日韩亚洲欧美| 久久精品在线观看| 欧美国产一区二区在线观看| 最新日韩中文字幕| 欧美日韩精品欧美日韩精品一| 亚洲人成久久| 亚洲一区二区网站| 国产日本欧美一区二区| 久久九九99| 欧美激情视频在线播放 | 欧美xx视频| 亚洲黄色一区| 亚洲欧美日韩在线不卡| 国产欧美日韩免费| 久久女同精品一区二区| 亚洲激情不卡| 久久aⅴ乱码一区二区三区| 国内精品模特av私拍在线观看| 久久久久久久综合色一本| 亚洲国产精品一区制服丝袜| 亚洲一区欧美激情| 韩日欧美一区二区三区| 欧美激情亚洲自拍| 亚洲欧美激情视频在线观看一区二区三区 | 免费视频一区| 亚洲视频在线二区| 久久中文精品| 亚洲午夜国产成人av电影男同| 国产精品永久免费| 牛牛影视久久网| 亚洲一区精彩视频| 欧美电影免费观看| 午夜久久影院| 日韩一级黄色av| 国产欧美一区二区三区在线老狼 | 久久亚洲精品网站| 一区二区三区久久久| 米奇777在线欧美播放| 一本色道**综合亚洲精品蜜桃冫 | 99re热这里只有精品视频| 国产亚洲第一区| 欧美日韩精品在线| 久久天天狠狠| 亚洲欧美一区二区三区在线 | 欧美怡红院视频| 亚洲欧洲一区二区三区| 国内精品久久久久影院 日本资源| 欧美激情亚洲另类| 久久免费视频在线观看| 亚洲欧美制服中文字幕| 日韩亚洲欧美一区| 亚洲国产精品久久久久秋霞蜜臀 | 欧美在线资源| 国产精品99久久久久久人| 亚洲人精品午夜在线观看| 久久综合一区二区三区| 欧美一区二区三区另类| 亚洲欧美久久久| 一区二区三区不卡视频在线观看| 在线观看精品一区| 国产日产欧产精品推荐色| 国产精品xxxxx| 欧美视频福利| 欧美日韩你懂的| 欧美激情精品久久久久| 免费在线观看精品| 另类酷文…触手系列精品集v1小说| 先锋资源久久| 欧美一区二区日韩一区二区| 午夜一区二区三区在线观看| 亚洲一区在线直播| 亚洲一区二区三区在线看| 亚洲一区二区三区四区五区午夜| 在线视频亚洲| 亚洲综合色噜噜狠狠| 亚洲一级特黄| 午夜精品久久久久久久99热浪潮| 亚洲一区二区三区四区中文| 午夜精品久久久久久久久| 亚洲欧美中文日韩v在线观看| 欧美亚洲午夜视频在线观看| 欧美在线一区二区| 老鸭窝91久久精品色噜噜导演| 久久综合九色99| 欧美美女视频| 国产精品久久久久高潮| 国产欧美va欧美va香蕉在| 国产日韩欧美二区| 1000部国产精品成人观看| 亚洲国产欧美日韩精品| 亚洲国产精品一区在线观看不卡| 日韩午夜激情| 亚洲国产精彩中文乱码av在线播放| 亚洲色在线视频| 亚洲欧美国内爽妇网| 欧美在线在线| 久久综合给合| 亚洲激情婷婷| 亚洲视频在线观看网站| 欧美专区18| 免费观看一区| 欧美午夜免费影院| 激情文学一区| 在线性视频日韩欧美| 久久精品日产第一区二区| 免费在线欧美黄色| aa日韩免费精品视频一| 欧美一区视频在线| 欧美韩日视频| 国产欧美一区二区精品秋霞影院| 精品动漫一区| 亚洲香蕉在线观看| 免费在线观看日韩欧美| 中文在线不卡| 美女诱惑一区| 国产一区二区高清| 中文欧美在线视频| 亚洲一二三区精品| 久久精品国产第一区二区三区| 欧美国产一区二区三区激情无套| 一区二区三区视频在线| 久久麻豆一区二区| 国产精品成人av性教育| 亚洲国产专区校园欧美| 欧美有码视频| 夜夜嗨av一区二区三区| 久热这里只精品99re8久| 国产伦精品一区二区三区四区免费| 亚洲精品欧美激情| 久久免费午夜影院|