• <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>

            Codejie's C++ Space

            Using C++

            .x練習 - 動態Mesh

            ??? 添加Animation數據到test.x中,全內容如下:
            xof?0303txt?0032

            Frame?Root?{
            ????FrameTransformMatrix?{
            ????1.000000,?0.000000,?0.000000,?0.000000,
            ????0.000000,?1.000000,?0.000000,?0.000000,
            ????0.000000,?0.000000,?1.000000,?0.000000,
            ????0.000000,?0.000000,?0.000000,?1.000000;;
            ????}
            ????Mesh?MeshObj?{
            ????????12;
            ????????0.000000;?0.000000;?1.000000;,
            ????????1.000000;?0.000000;?1.000000;,
            ????????1.000000;?1.000000;?1.000000;,
            ????????0.000000;?1.000000;?1.000000;,
            ????????0.000000;?0.000000;?0.000000;,
            ????????1.000000;?0.000000;?0.000000;,
            ????????1.000000;?1.000000;?0.000000;,
            ????????0.000000;?1.000000;?0.000000;,
            ????????0.000000;?0.000000;?-1.000000;,
            ????????1.000000;?0.000000;?-1.000000;,
            ????????1.000000;?1.000000;?-1.000000;,
            ????????0.000000;?1.000000;?-1.000000;;
            ????????
            ????????20;
            ????????3;?0,?4,?1;,
            ????????3;?4,?5,?1;,
            ????????3;?1,?2,?0;,
            ????????3;?2,?3,?0;,
            ????????3;?6,?2,?5;,
            ????????3;?2,?1,?5;,
            ????????3;?3,?2,?7;,
            ????????3;?2,?6,?7;,
            ????????3;?7,?4,?3;,
            ????????3;?4,?0,?3;,
            ????????3;?4,?8,?5;,
            ????????3;?5,?8,?9;,
            ????????3;?5,?9,?6;,
            ????????3;?9,?10,?6;,
            ????????3;?6,?10,?11;,
            ????????3;?7,?6,?11;,
            ????????3;?7,?11,?8;,
            ????????3;?4,?7,?8;,
            ????????3;?8,?10,?9;,
            ????????3;8,?11,?10;;
            ????????
            ????????MeshNormals?{
            ????????????12;
            ????????????-0.333333;?-0.333333;?0.333333;,
            ????????????0.333333;?-0.333333;?0.333333;,
            ????????????0.333333;?0.333333;?0.333333;,
            ????????????-0.333333;?0.333333;?0.333333;,
            ????????????-0.500000;?-0.500000;?0.000000;,
            ????????????0.500000;?-0.500000;?0.000000;,
            ????????????0.500000;?0.500000;?0.000000;,
            ????????????-0.500000;?0.500000;?0.000000;,
            ????????????-0.333333;?-0.333333;?-0.333333;,
            ????????????0.333333;?-0.333333;?-0.333333;,
            ????????????0.333333;?0.333333;?-0.333333;,
            ????????????-0.333333;?0.333333;?-0.333333;,
            ????????????
            ????????????20;
            ????????????3;?0,?4,?1;,
            ????????????3;?4,?5,?1;,
            ????????????3;?1,?2,?0;,
            ????????????3;?2,?3,?0;,
            ????????????3;?6,?2,?5;,
            ????????????3;?2,?1,?5;,
            ????????????3;?3,?2,?7;,
            ????????????3;?2,?6,?7;,
            ????????????3;?7,?4,?3;,
            ????????????3;?4,?0,?3;,
            ????????????3;?4,?8,?5;,
            ????????????3;?5,?8,?9;,
            ????????????3;?5,?9,?6;,
            ????????????3;?9,?10,?6;,
            ????????????3;?6,?10,?11;,
            ????????????3;?7,?6,?11;,
            ????????????3;?7,?11,?8;,
            ????????????3;?4,?7,?8;,
            ????????????3;?8,?10,?9;,
            ????????????3;?8,?11,?10;;
            ????????}
            ????????
            ????????XSkinMeshHeader?{
            ????????????1;
            ????????????3;
            ????????????4;
            ????????}
            ????????SkinWeights?{
            ????????????"bone1";
            ????????????1;
            ????????????0;
            ????????????1.000000;
            ??????????? 1.000000,?0.000000,?0.000000,?0.000000,
            ????????????0.000000, 1.000000,?0.000000,?0.000000,
            ????????????0.000000,?0.000000, 1.000000,?0.000000,
            ????????????0.000000,?0.000000,?0.000000, 1.000000;;????????????
            ????????}????????
            ????????SkinWeights?{
            ????????????"bone2";
            ????????????1;
            ????????????1;
            ????????????1.000000;
            ????????????1.000000,?0.000000,?0.000000,?0.000000,
            ????????????0.000000,?1.000000,?0.000000,?0.000000,
            ????????????0.000000,?0.000000,?1.000000,?0.000000,
            ????????????0.000000,?0.000000,?0.000000,?1.000000;;????????????
            ????????}
            ????????SkinWeights?{
            ????????????"bone3";
            ????????????1;
            ????????????2;
            ????????????1.000000;
            ????????????1.000000,?0.000000,?0.000000,?0.000000,
            ????????????0.000000,?1.000000,?0.000000,?0.000000,
            ????????????0.000000,?0.000000,?1.000000,?0.000000,
            ????????????0.000000,?0.000000,?0.000000,?1.000000;;????????????
            ????????}
            ????????SkinWeights?{
            ????????????"bone4";
            ????????????1;
            ????????????3;
            ????????????1.000000;
            ????????????1.000000,?0.000000,?0.000000,?0.000000,
            ????????????0.000000,?1.000000,?0.000000,?0.000000,
            ????????????0.000000,?0.000000,?1.000000,?0.000000,
            ????????????0.000000,?0.000000,?0.000000,?1.000000;;????????????
            ????????}????????
            ????}
            }


            AnimationSet?{
            ????Animation?{
            ????????{?bone1?}????
            ????????AnimationKey?{
            ?????????2;
            ?????????2;
            ?????????0;
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????2;
            ?????????3;
            ?????????-1.000000,-1.000000,0.000000;;;
            ????????}
            ????}
            }

            AnimationSet?{
            ????Animation?{
            ????????{?bone2?}????
            ????????AnimationKey?{
            ?????????2;
            ?????????2;
            ?????????0;
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????4;
            ?????????3;
            ?????????1.000000,-1.000000,0.000000;;;
            ????????}
            ????}
            }

            AnimationSet?{
            ????Animation?{
            ????????{?bone3?}????
            ????????AnimationKey?{
            ?????????2;
            ?????????2;
            ?????????0;
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????6;
            ?????????3;
            ?????????1.000000,1.000000,0.000000;;;
            ????????}
            ????}
            }

            AnimationSet?{
            ????Animation?{
            ????????{?bone4?}????
            ????????AnimationKey?{
            ?????????2;
            ?????????2;
            ?????????0;
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????8;
            ?????????3;
            ?????????-1.000000,1.000000,0.000000;;;
            ????????}
            ????}
            }

            ??? .x的Animation內容是讓立方體上部的4個vertex每隔兩幀向外延對角平移一個vertex, 通過DE顯示效果如下:



            test.x_anim.jpg

            ??? 這里說明一下.x部分內容:
            ????????XSkinMeshHeader?{
            ????????????1;
            ????????????3;
            ????????????4;//有四個vertex需要單獨移動,因此需要定義四個“bone”(姑且稱為bone吧)
            ????????}
            ????????SkinWeights?{
            ????????????"bone1";
            ????????????1;//bone作用與一個vertex
            ????????????0;//被作用的vertex的索引為0
            ????????????1.000000;//bone對指定vertex的作用力大小,或稱為“權重”,用于當多個bone作用于同一vertex時,進行力度分配。例如,如果是0.5,則此bone的作用力減半;
            ??????????? 1.000000,?0.000000,?0.000000,?0.000000,
            ????????????0.000000, 1.000000,?0.000000,?0.000000,
            ????????????0.000000,?0.000000, 1.000000,?0.000000,
            ????????????0.000000,?0.000000,?0.000000, 1.000000;; //bone初始Matrix,作用還不清楚;
            ????????}????????

            AnimationSet?{
            ????Animation?{
            ????????{?bone1?}??? //指定作用的bone
            ????????AnimationKey?{
            ?????????2;//指定動作類型,這里是平移:這里說明下,這個段叫做KeyType,在Directx的SDK(2008.11)中說:
            ?????????? //
            keyType - Specifies whether the keys are rotation, scale, position, or matrix keys (using the integers 0, 1, 2, or 3, respectively).
            ????????? //但實際使用中的值卻是0,1,2,4,很奇怪;
            ?????????2;//指定有幾個幀
            ?????????0;//起始幀
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????2;//終止幀
            ?????????3;
            ?????????-1.000000,-1.000000,0.000000;;;//平移變化量
            ????????}
            ????}
            }

            ??? 詳細說明請參考:
            ??????????????????????????? 1.http://www.shnenglu.com/lovedday/archive/2008/05/27/51278.html
            ??????????????????????????? 2.http://blog.csdn.net/linber214/archive/2008/10/16/3082490.aspx

            posted on 2009-04-16 23:15 codejie 閱讀(293) 評論(0)  編輯 收藏 引用 所屬分類: 隨筆而已MPQ - WOW

            公告

            Using C++

            導航

            統計

            留言簿(73)

            隨筆分類(513)

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            久久久久香蕉视频| 亚洲狠狠久久综合一区77777| 亚洲精品高清久久| 色狠狠久久AV五月综合| 久久伊人精品青青草原日本| 国产99久久久国产精免费| 免费国产99久久久香蕉| 69SEX久久精品国产麻豆| 国产亚洲精品自在久久| 久久精品国产亚洲av水果派 | 久久久久国产精品三级网| 成人国内精品久久久久影院VR| 国产 亚洲 欧美 另类 久久| 久久婷婷久久一区二区三区| 国产精品久久网| 亚洲国产精品一区二区久久| 久久被窝电影亚洲爽爽爽| 99久久精品无码一区二区毛片| 伊人久久精品影院| 91麻豆国产精品91久久久| 国产成人综合久久精品红| A级毛片无码久久精品免费| 亚洲中文字幕无码一久久区| 日韩精品久久无码人妻中文字幕 | 国产精品久久久久久久久鸭 | 欧美日韩中文字幕久久伊人| 日本久久久精品中文字幕| 国产精品成人99久久久久 | 久久久久四虎国产精品| 青青热久久综合网伊人| 国产精品成人久久久久三级午夜电影| 无码人妻少妇久久中文字幕| 色综合久久88色综合天天 | 国内精品伊人久久久影院| 亚洲国产精品无码久久久蜜芽| 9191精品国产免费久久| 久久精品国产精品亚洲艾草网美妙| 97久久婷婷五月综合色d啪蜜芽| 一本久久久久久久| 久久露脸国产精品| 日韩av无码久久精品免费|