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

天行健 君子當自強而不息

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


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(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| 久久精品二区亚洲w码| 国产在线视频欧美一区二区三区| 欧美成人国产| 最新高清无码专区| 日韩视频在线观看一区二区| 欧美日韩1区2区| 亚洲制服少妇| 欧美在线视频观看| 亚洲高清一二三区| 亚洲精品欧美极品| 国产欧美精品国产国产专区| 久久影院午夜论| 欧美日本三区| 久久精品三级| 欧美二区在线观看| 欧美一区二区啪啪| 久久一本综合频道| 中文欧美字幕免费| 久久久国产精品亚洲一区| 亚洲精品久久久久久久久久久久| 99re热这里只有精品视频| 国产亚洲福利社区一区| 亚洲国产日韩一级| 国产夜色精品一区二区av| 欧美高清自拍一区| 国产欧美日韩综合| 91久久久久久久久久久久久| 国产老肥熟一区二区三区| 欧美激情小视频| 国产伦精品一区二区三区高清版 | 欧美日韩高清在线| 久久国产婷婷国产香蕉| 欧美国产一区二区| 久久人体大胆视频| 国产精品扒开腿爽爽爽视频| 美国十次成人| 国产农村妇女精品一二区| 亚洲欧洲另类| 影音先锋一区| 香蕉成人伊视频在线观看| 一本久久综合| 欧美高清视频在线播放| 久久网站免费| 国产亚洲激情在线| 亚洲网站在线看| 在线亚洲一区| 欧美精品一区二区三区一线天视频| 久久精品99国产精品| 国产精品高清一区二区三区| 亚洲欧洲久久| 亚洲精品女人| 欧美成人中文字幕在线| 免费在线欧美黄色| 一区视频在线看| 久久精品成人一区二区三区蜜臀| 欧美一区观看| 国产精自产拍久久久久久| 在线视频精品| 亚洲尤物在线| 国产精品久久久久久超碰| 亚洲美女区一区| 亚洲视频导航| 国产精品theporn| 亚洲一二三四久久| 欧美一区二区在线看| 欧美va天堂| 136国产福利精品导航| 久久美女艺术照精彩视频福利播放| 久久九九久精品国产免费直播| 国产精品私房写真福利视频| 亚洲午夜精品国产| 久久国产欧美日韩精品| 国产一区二区三区奇米久涩| 欧美一区二区三区视频免费| 久久精品国产亚洲一区二区| 国际精品欧美精品| 久久综合色影院| 亚洲丁香婷深爱综合| 99re6热只有精品免费观看| 欧美日韩一区二区三区四区在线观看 | 欧美日韩精品免费| 一区二区高清视频在线观看| 欧美夜福利tv在线| 国产一区二区三区的电影| 久久国产精品99国产精| 免费视频一区| 日韩一级在线| 国产日韩欧美不卡在线| 久久久亚洲高清| 亚洲黄色av| 欧美一区二区女人| 亚洲第一毛片| 国产精品99免费看 | 亚洲性线免费观看视频成熟| 国产精品一区二区欧美| 久久久久五月天| 亚洲免费高清视频| 久久美女艺术照精彩视频福利播放| 91久久久亚洲精品| 国产精品爱久久久久久久| 久久久999国产| 一区二区欧美国产| 欧美+日本+国产+在线a∨观看| 亚洲免费观看在线观看| 国产毛片一区二区| 欧美精品九九99久久| 欧美在线播放视频| 亚洲美女网站| 欧美成人国产| 久久精品人人做人人爽电影蜜月| 亚洲乱码国产乱码精品精可以看 | 伊人久久婷婷色综合98网| 欧美另类视频| 久久中文字幕导航| 亚洲一区二区精品视频| 亚洲韩国青草视频| 久久午夜激情| 久久高清福利视频| 在线看国产日韩| 国产自产精品| 国产精品影片在线观看| 欧美日韩a区| 欧美国产视频在线| 久久综合九色综合久99| 亚洲私人影吧| 日韩亚洲欧美在线观看| 欧美国产日韩在线| 久久久久久亚洲综合影院红桃 | 欧美亚洲一区二区在线| 99国产精品视频免费观看一公开| 韩日在线一区| 国产综合色产| 国产综合在线看| 国产日韩精品久久| 国产麻豆午夜三级精品| 国产精品久久一卡二卡| 欧美日韩免费一区二区三区视频| 欧美国产日产韩国视频| 免费国产一区二区| 久久综合色影院| 美女精品国产| 欧美成人按摩| 欧美男人的天堂| 欧美日韩国产综合视频在线观看中文| 欧美1区2区视频| 欧美精品色综合| 欧美日韩精品欧美日韩精品 | 亚洲欧美一区二区三区久久| 亚洲视频图片小说| 亚洲欧美一区二区三区在线| 亚洲欧美中文日韩v在线观看| 亚洲欧美日韩精品| 欧美主播一区二区三区美女 久久精品人 | 在线亚洲自拍| 午夜亚洲福利| 久久激情中文| 欧美插天视频在线播放| 欧美日本一区| 国产精品推荐精品| 韩国一区电影| 亚洲日本黄色| 亚洲免费视频在线观看| 久久动漫亚洲| 欧美成人黑人xx视频免费观看| 亚洲福利电影| 亚洲一区二区在线| 久久久久久综合| 欧美人与性动交α欧美精品济南到| 国产精品九九久久久久久久| 国产亚洲福利社区一区| 91久久精品国产| 午夜精品三级视频福利| 久久人人看视频| 99精品视频一区| 久久av老司机精品网站导航| 牛夜精品久久久久久久99黑人| 欧美少妇一区二区| 国产在线精品二区| 99热在线精品观看| 久久精品久久综合| 亚洲国产精品日韩| 性xx色xx综合久久久xx| 欧美a级一区| 国产精品美女视频网站| 亚洲黄色免费网站| 欧美一区二区三区日韩| 91久久久久久| 久久久久久久999精品视频| 欧美视频网站| 亚洲人体影院| 久久伊人亚洲| 亚洲综合欧美| 欧美日韩亚洲综合在线| 亚洲福利视频网| 久久九九热免费视频| 中日韩男男gay无套| 久久综合久久美利坚合众国|