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

            天行健 君子當自強而不息

            加載MD2文件播放角色動畫

            MD2文件由兩個主要部分組成:文件頭和數(shù)據(jù)。

            文件頭部分: 包含模型描述,多邊形數(shù),頂點數(shù)和動畫細節(jié)等。
            數(shù)據(jù)部分:  組成模型的多邊形網(wǎng)格的數(shù)據(jù),包括所有的多邊形,頂點和紋理數(shù)據(jù)。

            在MD2文件中,所有的多邊形都為三角形,且沒有其他的實體。
            頂點數(shù)據(jù)定義的不是單幀而是多幀動畫。事實上,每個MD2文件包含198幀動畫,編號為0-197。

            MD2文件頭數(shù)據(jù)結構定義:
            // This is the header structure for a Quake II .MD2 file by id Software
            typedef struct MD2_HEADER_TYPE
            {
                
            int identifier;          // identifies the file type, should be "IDP2"
                int version;             // version number, should be 8.
                int skin_width;        // width of texture map used for skinning
                int skin_height;       // height of texture map used for skinning
                int framesize;          // number of bytes in a single frame of animation

                
            int num_skins;        // total number of skins,
                                             
            // listed by ASCII filename and are available for loading if files are found in full path.

                
            int num_verts;        // number of vertices in each model frame, 
                                             
            // the number of vertices in each frame is always the same.

                
            int num_textcoords; // total number of texture coordinates in entire file,
                                              
            // may be larger than the number of vertices.

                
            int num_polys;        // number of polygons per model, or per frame of animation if you will.

                
            int num_openGLcmds; // number of openGL commands which can help with rendering optimization,
                                                   
            // however, we won't be using them.

                
            int num_frames;     // total number of animation frames

                
            // memory byte offsets to actual data for each item

                
            int offset_skins;       // offset in bytes from beginning of file to the skin array that holds the file name
                                              
            // for each skin, each file name record is 64 bytes.

                
            int offset_textcoords;  // offset in bytes from the beginning of file to the texture coordinate array
                int offset_polys;          // offset in bytes from the beginning of file to the polygon mesh
                int offset_frames;       // offset in bytes from the beginning of file to the vertex data for each frame
                int offset_openGLcmds;  // offset in bytes from the beginning of file to the openGL commands
                int offset_end;         // offset in bytes from the beginning of file to end of file
            } MD2_HEADER, *MD2_HEADER_PTR;


            線框模式


            實體模式

            其他模型






            posted on 2007-04-24 02:15 lovedday 閱讀(1044) 評論(2)  編輯 收藏 引用

            評論

            # re: 加載MD2文件播放角色動畫 2008-03-18 14:24 阿飛

            謝謝! 感悟...  回復  更多評論   

            # re: 加載MD2文件播放角色動畫 2012-03-09 10:13 preboy

            可以弄個源代碼嗎、詳細講解下在游戲中怎樣運用以顯示一個MESH,  回復  更多評論   

            公告

            導航

            統(tǒng)計

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關鏈接

            搜索

            最新評論

            久久久精品国产sm调教网站| 久久久久国色AV免费观看| 伊人久久大香线蕉综合热线| 中文精品久久久久人妻| 91久久婷婷国产综合精品青草| 久久精品国产99国产精品澳门| 激情五月综合综合久久69| 99精品国产免费久久久久久下载| 久久久久成人精品无码中文字幕| 国产精品成人精品久久久| 久久精品日日躁夜夜躁欧美| 91久久精品电影| 亚洲va久久久噜噜噜久久| 欧美精品福利视频一区二区三区久久久精品 | 四虎国产精品免费久久5151| 久久无码AV中文出轨人妻| 97久久精品午夜一区二区| 久久久中文字幕日本| 国产精品毛片久久久久久久 | 久久亚洲高清综合| 99久久国语露脸精品国产| 国产色综合久久无码有码| 久久99精品国产99久久6| 国内精品久久久久久99| 久久综合亚洲色HEZYO社区| 精品欧美一区二区三区久久久 | 精品蜜臀久久久久99网站| 精品久久久无码21p发布| 深夜久久AAAAA级毛片免费看| 久久久久国产视频电影| 国产日韩久久久精品影院首页| 久久亚洲国产精品一区二区| 99国产精品久久久久久久成人热| 无码人妻久久一区二区三区| 波多野结衣AV无码久久一区| 99久久做夜夜爱天天做精品| 热99RE久久精品这里都是精品免费| 爱做久久久久久| 久久久精品久久久久久| 久久久久国产精品麻豆AR影院| 国产精品美女久久久免费|