• <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練習(xí) - 動(dòng)態(tài)Mesh

            ??? 添加Animation數(shù)據(jù)到test.x中,全內(nèi)容如下:
            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內(nèi)容是讓立方體上部的4個(gè)vertex每隔兩幀向外延對(duì)角平移一個(gè)vertex, 通過DE顯示效果如下:



            test.x_anim.jpg

            ??? 這里說明一下.x部分內(nèi)容:
            ????????XSkinMeshHeader?{
            ????????????1;
            ????????????3;
            ????????????4;//有四個(gè)vertex需要單獨(dú)移動(dòng),因此需要定義四個(gè)“bone”(姑且稱為bone吧)
            ????????}
            ????????SkinWeights?{
            ????????????"bone1";
            ????????????1;//bone作用與一個(gè)vertex
            ????????????0;//被作用的vertex的索引為0
            ????????????1.000000;//bone對(duì)指定vertex的作用力大小,或稱為“權(quán)重”,用于當(dāng)多個(gè)bone作用于同一vertex時(shí),進(jìn)行力度分配。例如,如果是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;//指定動(dòng)作類型,這里是平移:這里說明下,這個(gè)段叫做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).
            ????????? //但實(shí)際使用中的值卻是0,1,2,4,很奇怪;
            ?????????2;//指定有幾個(gè)幀
            ?????????0;//起始幀
            ?????????3;
            ?????????0.000000,0.000000,0.000000;;,
            ?????????2;//終止幀
            ?????????3;
            ?????????-1.000000,-1.000000,0.000000;;;//平移變化量
            ????????}
            ????}
            }

            ??? 詳細(xì)說明請(qǐng)參考:
            ??????????????????????????? 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 閱讀(305) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 隨筆而已MPQ - WOW

            公告

            Using C++

            導(dǎo)航

            統(tǒng)計(jì)

            留言簿(73)

            隨筆分類(513)

            積分與排名

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            亚洲国产精品无码久久98| 久久久一本精品99久久精品88| 熟妇人妻久久中文字幕| 日韩精品无码久久久久久| 91精品国产高清91久久久久久| 亚洲国产精品一区二区久久| 日韩久久无码免费毛片软件| 99久久这里只精品国产免费| 久久午夜伦鲁片免费无码| 国产福利电影一区二区三区久久久久成人精品综合 | 久久中文字幕视频、最近更新| 久久亚洲国产成人影院| 成人国内精品久久久久影院| 久久午夜免费视频| 99久久国产主播综合精品 | 国产精品久久久久久搜索| 久久久久久亚洲精品不卡| 国产精品一久久香蕉国产线看观看| 99久久国产亚洲高清观看2024| 色8久久人人97超碰香蕉987| 久久综合九色欧美综合狠狠| 久久亚洲国产欧洲精品一| 嫩草伊人久久精品少妇AV| 国产精品久久久久免费a∨| 精品久久久久久久中文字幕| 97精品久久天干天天天按摩| 一本久道久久综合狠狠爱| 亚洲国产精品嫩草影院久久| 久久成人18免费网站| 青青草国产精品久久久久| 国产亚洲精品自在久久| 色偷偷88888欧美精品久久久| 久久久午夜精品| 久久精品国产99久久久古代| 性做久久久久久久久浪潮| 欧美性猛交xxxx免费看久久久| 久久精品无码专区免费| 国产精品无码久久综合网| 久久精品国产一区二区三区不卡| 久久91综合国产91久久精品| 久久国产精品99久久久久久老狼|