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

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

Using the .X File Format(3)

Embedding Data Objects and Template Restrictions

Data referencing has one caveat−the template restrictions set in place must allow you to use a reference. That might not make sense at first, but you can't use a data reference without the proper restrictions. An .X file represents an entire hierarchy of data objects, which can only be siblings or children of other objects. Thus, data objects embedded in other objects need the proper restrictions to be referenced or instanced. For example, consider the following three template declarations:

template ClosedTemplate {
  <4C9D055B−C64D−4bfe−A7D9−981F507E45FF>
  DWORD ClosedData;
}

template OpenTemplate {
  <4C9D055B−C64D−4bff−A7D9−981F507E45FF>
  DWORD OpenData;
  [...]
}

template RestrictedTemplate {
  <4C9D055B−C64D−4c00−A7D9−981F507E45FF>
  DWORD RestrictedData;
  [ClosedTemplate]
  [OpenTemplate]
}

They are pretty standard template declarations, except for the lines that contain square brackets. The information inside those square brackets is important. The first template, ClosedTemplate, doesn't have square brackets, so it is considered a closed template. You can only instance and define the ClosedData value inside ClosedTemplate.

The OpenTemplate, however, contains the [] line, which signifies that it is an open template. An open template allows any data object to be embedded in place of the [] line. For example, you can instance OpenTemplate, define the OpenData variable, and then embed an instance of ClosedTemplate within the OpenTemplate.

RestrictedTemplate has two lines of bracket text. Restricting templates only allow data objects of those template types listed; in this case, those templates are ClosedTemplate and OpenTemplate. Attempts to embed any other data object other than the two listed will fail (causing the parse to fail).

Whew−you might have to reread this section a few times to fully understand the ability to embed and restrict templates within other templates. Once you have a firm grasp on embedding and restricting, it's time to move on and learn about DirectX's pre−defined standard templates, which are packaged with the DirectX SDK.

 

Working with the DirectX Standard Templates

Now that you've worked your way through templates and data objects, you can move up a step and see what you can do with them in your project. If you've taken the time to play around with the DirectX SDK, you'll notice that .X is widely used for containing mesh information. To that end, Microsoft has packaged DirectX with a number of templates, which I call the DirectX standard templates. These templates are used to contain all mesh−related data.

The standard templates are useful because they define almost every aspect of 3D meshes, so take a moment to study them here.

The standard templates, shown in Table 3.2, each have a matching GUID macro that you use to determine which data object is which in your program. These macros are defined (using DEFINE_GUID) inside a special file named rmxfguid.h. The standard templates' GUID macros are easy to remember because you just prefix the template's name with D3DRM_TID. For instance, the Animation template is defined by the macro D3DRM_TIDAnimation.

 

Animation

Contains animations referencing a previous frame. It should contain one reference to a frame and at least one set of AnimationKey templates. It also can contain an AnimationOptions data object.

template Animation
{
< 3D82AB4F-62DA-11cf-AB39-0020AF71E433 >
[...]
}

Where:

  • [ ... ] - Any .x file template can be used here. This makes the architecture extensible.

AnimationKey

Defines a set of animation keys. A matrix key is useful for sets of animation data that need to be represented as transformation matrices.

template AnimationKey
{
< 10DD46A8-775B-11CF-8F52-0040333594A3 >
DWORD keyType;
DWORD nKeys;
array TimedFloatKeys keys[nKeys];
}

Where:

  • keyType - Specifies whether the keys are rotation, scale, position, or matrix keys (using the integers 0, 1, 2, or 3, respectively).
  • nKeys - Number of keys.
  • keys - An array of keys. See TimedFloatKeys.

AnimationOptions

Enables you to set animation options.

template AnimationOptions
{
< E2BF56C0-840F-11cf-8F52-0040333594A3 >
DWORD openclosed;
DWORD positionquality;
}

Where:

  • openclosed - Use 0 for a closed animation, or 1 for an open animation. By default, an animation is closed.
  • positionquality - Set the position quality for any position keys specified. Use 0 for spline positions or 1 for linear positions.

AnimationSet

Contains one or more Animation objects. Each animation within an animation set has the same time at any given point. Increasing the animation set's time increases the time for all the animations it contains.

template AnimationSet
{
< 3D82AB50-62DA-11cf-AB39-0020AF71E433 >
[ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ]
}

Where:

  • [ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ] - Optional animation template.

Boolean

Defines a simple Boolean type.

template Boolean
{
< 537da6a0-ca37-11d0-941c-0080c80cfa7b >
DWORD truefalse;
}

Where:

  • truefalse - True for a Boolean, false otherwise.

Boolean2d

Defines a set of two Boolean values used in the MeshFaceWraps template to define the texture topology of an individual face.

template Boolean2d
{
< 4885AE63-78E8-11cf-8F52-0040333594A3 >
Boolean u;
Boolean v;
}

Where:

  • u - Boolean value. See Boolean.
  • v - Boolean value. See Boolean.

ColorRGB

Defines the basic RGB color object.

template ColorRGB
{
< D3E16E81-7835-11cf-8F52-0040333594A3 >
float red;
float green;
float blue;
}

ColorRGBA

Defines a color object with an alpha component. This is used for the face color in the material template definition.

template ColorRGBA
{
< 35FF44E0-6C7C-11cf-8F52-0040333594A3 >
float red;
float green;
float blue;
float alpha;
}

Coords2d

Defines a two dimensional vector used to define a mesh's (u, v) texture coordinates.

template Coords2d
{
< F6F23F44-7686-11cf-8F52-0040333594A3 >
float u;
float v;
}
  • u - u coordinate value.
  • v - v coordinate value.

FloatKeys

Defines an array of floating-point numbers (floats) and the number of floats in that array. This is used for defining sets of animation keys.

template FloatKeys
{
< 10DD46A9-775B-11cf-8F52-0040333594A3 >
DWORD nValues;
array float values[nValues];
}
  • nValues - Number of floats.
  • values[nValues] - Array of float values.

FrameTransformMatrix

Defines a local transform for a frame (and all its child objects).

template FrameTransformMatrix
{
< F6F23F41-7686-11cf-8F52-0040333594A3 >
Matrix4x4 frameMatrix;
}

Where:

  • frameMatrix - A Matrix4x4 template.

Frame

Defines a coordinate frame, or "frame of reference." The Frame template is open and can contain any object. The D3DX mesh-loading functions recognize Mesh, FrameTransformMatrix, and Frame template instances as child objects when loading a Frame instance.

template Frame
{
< 3D82AB46-62DA-11CF-AB39-0020AF71E433 >
[...]
}

The frame template recognizes child Frame and Mesh nodes inside a frame and can recognize user-defined templates through a callback function.


posted on 2008-04-16 19:56 lovedday 閱讀(437) 評論(0)  編輯 收藏 引用


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


公告

導(dǎo)航

統(tǒng)計

常用鏈接

隨筆分類(178)

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

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美在线影院| 欧美国产精品久久| 国产农村妇女毛片精品久久麻豆 | 亚洲自拍偷拍一区| 欧美小视频在线观看| 亚洲欧美中文日韩v在线观看| 一本色道久久综合狠狠躁篇怎么玩| 欧美日韩直播| 欧美一级精品大片| 久久精品一二三| 亚洲精品一二| 亚洲网站啪啪| 一区二区三区在线观看视频| 欧美激情精品久久久久久久变态| 欧美精品一区在线观看| 香蕉久久久久久久av网站| 午夜在线一区| 亚洲人成小说网站色在线| 99热这里只有精品8| 国产日韩欧美中文| 另类综合日韩欧美亚洲| 欧美日本亚洲| 久久精品视频va| 老鸭窝毛片一区二区三区| 亚洲一区二区毛片| 久久久噜噜噜久久中文字幕色伊伊| 亚洲人午夜精品免费| 亚洲综合国产激情另类一区| 亚洲第一在线视频| 99re8这里有精品热视频免费| 国产一区二区三区观看| 亚洲精品少妇30p| 国产午夜久久久久| 亚洲精品欧美日韩| 精品电影在线观看| 亚洲视频在线二区| 亚洲区免费影片| 羞羞色国产精品| 99热免费精品| 久久久久国产精品麻豆ai换脸| 一区二区三区产品免费精品久久75| 久久av一区二区三区漫画| 夜夜躁日日躁狠狠久久88av| 久久久久国产一区二区三区| 亚洲午夜精品一区二区| 免费观看久久久4p| 久久九九国产精品怡红院| 欧美午夜免费影院| 亚洲国产欧美一区二区三区丁香婷| 国产美女精品免费电影| 99re6热在线精品视频播放速度| 在线成人h网| 欧美在线黄色| 久久激情婷婷| 国产精品美女黄网| 妖精视频成人观看www| 亚洲六月丁香色婷婷综合久久| 久久精品综合一区| 欧美伊人久久| 国产精品亚洲不卡a| 亚洲一区美女视频在线观看免费| 99综合电影在线视频| 欧美国产日韩在线观看| 亚洲国产欧美日韩另类综合| 一区二区三区在线观看欧美| 久久高清一区| 麻豆成人综合网| 影音先锋久久久| 老牛影视一区二区三区| 美女网站久久| 亚洲国产日韩在线一区模特| 久久综合久久综合久久| 欧美肥婆在线| 亚洲精品久久| 欧美日韩 国产精品| 日韩视频免费| 亚洲欧美日韩精品综合在线观看| 国产精品久久久久久久久婷婷| 国产精品99久久久久久白浆小说| 午夜精品久久久久影视| 国产农村妇女毛片精品久久莱园子| 亚洲欧美成人精品| 久久精品女人的天堂av| 在线看无码的免费网站| 欧美mv日韩mv国产网站app| 亚洲人成小说网站色在线| 亚洲午夜女主播在线直播| 国产精品久久久久影院色老大| 亚洲欧美国产不卡| 久久综合九色| 在线欧美一区| 欧美激情影音先锋| 亚洲一区在线观看免费观看电影高清 | 99成人免费视频| 欧美一级视频精品观看| 一区二区三区在线观看欧美| 欧美暴力喷水在线| 在线中文字幕不卡| 久久女同互慰一区二区三区| 亚洲乱码国产乱码精品精天堂| 欧美午夜精品久久久久久超碰| 性亚洲最疯狂xxxx高清| 欧美激情视频一区二区三区免费 | 国产一区av在线| 欧美阿v一级看视频| 亚洲伊人伊色伊影伊综合网| 欧美成人福利视频| 亚洲欧美日韩综合aⅴ视频| 在线精品视频一区二区三四| 欧美三区在线视频| 久久九九有精品国产23| 一本久久a久久精品亚洲| 久久这里只有| 亚洲欧美日韩综合一区| 亚洲区中文字幕| 国产一区二区三区视频在线观看 | 欧美精品v日韩精品v韩国精品v | 日韩视频免费观看| 久久久久久久国产| 亚洲一区视频在线| 亚洲精品麻豆| 伊人狠狠色j香婷婷综合| 国产精品美女在线观看| 欧美国产91| 久久久亚洲高清| 午夜久久福利| 亚洲一区二区免费| av成人毛片| 亚洲人成网站影音先锋播放| 男人的天堂亚洲| 久久久欧美精品| 久久精品国产亚洲a| 午夜精品久久久久久久蜜桃app| 亚洲精品乱码久久久久久蜜桃91 | 欧美精品一区二区精品网| 久久夜色精品国产欧美乱极品| 午夜精品久久久久久久男人的天堂 | 一区二区欧美精品| 91久久精品国产| 欧美激情a∨在线视频播放| 久久综合狠狠综合久久激情| 久久福利一区| 欧美专区在线播放| 久久国产精品亚洲va麻豆| 欧美一区二区三区视频在线观看| 亚洲视频久久| 亚洲免费在线视频| 午夜精品久久久久影视| 午夜精品久久久久久久久久久久久| 亚洲一区二区精品在线观看| 亚洲午夜一区二区三区| 亚洲欧美在线看| 欧美一区二区久久久| 久久国产免费| 久久人人97超碰精品888| 美女国产精品| 欧美大片一区| 最新69国产成人精品视频免费| 亚洲人成久久| 亚洲午夜视频在线| 午夜精品久久久| 久久精品五月| 欧美电影免费观看高清完整版| 欧美国产精品一区| 国产精品v欧美精品v日本精品动漫| 国产精品久久久久影院亚瑟| 国产欧美一区二区色老头| 国产专区一区| 亚洲精品一区二区三区不| 亚洲在线视频一区| 久久精品一二三区| 欧美激情导航| 在线视频日韩| 久久久久国产免费免费| 欧美精品v日韩精品v国产精品| 国产精品久久久久久久久免费桃花 | 欧美视频中文字幕| 国产视频久久久久久久| 亚洲国产精品一区二区第四页av | 亚洲国产欧美一区| 亚洲午夜精品一区二区| 久久国产视频网| 亚洲精品1区2区| 午夜视频在线观看一区| 欧美国产激情| 国产真实乱偷精品视频免| 一区二区av| 久久色中文字幕| 中文国产成人精品| 免费成人av资源网| 国产欧美精品一区aⅴ影院| 亚洲精品孕妇| 久久久亚洲综合| 在线中文字幕一区| 免费日韩av电影| 国产手机视频一区二区| 亚洲天天影视| 亚洲黄色成人| 久久夜色精品亚洲噜噜国产mv| 国产精品久久久久影院亚瑟|