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

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

            加載MD2文件播放角色動(dòng)畫

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

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

            在MD2文件中,所有的多邊形都為三角形,且沒(méi)有其他的實(shí)體。
            頂點(diǎn)數(shù)據(jù)定義的不是單幀而是多幀動(dòng)畫。事實(shí)上,每個(gè)MD2文件包含198幀動(dòng)畫,編號(hào)為0-197。

            MD2文件頭數(shù)據(jù)結(jié)構(gòu)定義:
            // 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;


            線框模式


            實(shí)體模式

            其他模型






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

            評(píng)論

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

            謝謝! 感悟...  回復(fù)  更多評(píng)論   

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

            可以弄個(gè)源代碼嗎、詳細(xì)講解下在游戲中怎樣運(yùn)用以顯示一個(gè)MESH,  回復(fù)  更多評(píng)論   

            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(178)

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

            搜索

            最新評(píng)論

            久久综合九色综合久99| 综合久久给合久久狠狠狠97色 | 国产一区二区精品久久岳| 国产成人久久精品麻豆一区| 国产精品一区二区久久精品无码| 漂亮人妻被中出中文字幕久久| 亚洲色婷婷综合久久| 国产精品美女久久久网AV| 亚洲AV无码久久精品色欲| 97久久香蕉国产线看观看| 日本亚洲色大成网站WWW久久| 无码人妻久久一区二区三区免费丨 | 亚洲国产综合久久天堂| 久久精品无码专区免费青青| 精品久久久久中文字幕一区| 久久久久人妻精品一区二区三区| 久久AAAA片一区二区| 久久久亚洲欧洲日产国码二区| 久久久精品国产亚洲成人满18免费网站 | 7国产欧美日韩综合天堂中文久久久久 | 99久久精品免费观看国产| 久久久久久夜精品精品免费啦| 天堂无码久久综合东京热| 久久夜色tv网站| 欧洲人妻丰满av无码久久不卡| 亚洲欧美日韩精品久久亚洲区 | 日韩精品久久久久久久电影| 午夜久久久久久禁播电影| 精品无码人妻久久久久久| 青青青伊人色综合久久| 久久午夜羞羞影院免费观看| 免费一级欧美大片久久网 | 久久精品一本到99热免费| 18岁日韩内射颜射午夜久久成人| 日韩电影久久久被窝网| 久久久精品日本一区二区三区 | 久久精品国产秦先生| 精品久久久久久久| 亚洲一本综合久久| 狠狠久久亚洲欧美专区| 久久91综合国产91久久精品|