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

天行健 君子當自強而不息

D3D Animation Basis(7)

Updating Skinned Meshes

A skinned mesh works like this: Each vertex is attached to an imaginary bone (which is specified by a frame object). As these frames move, so do the vertices attached to them. To update the coordinates of the vertices as the bones move, you need to call a special function that takes the source vertex data, transforms it according to the bones' transformations, and stores the results in a second mesh object. This special function is called ID3DXSkinInfo::UpdateSkinnedMesh.

Whenever you load a mesh using the D3DXLoadSkinMeshFromXof function (which is what the second LoadMesh function does), you get a pointer to an ID3DXSkinInfo object. This object contains the information about which vertices are attached to which bones. This way, the object knows which transformations to apply to the vertices.

To update the vertices, you must first lock the mesh's vertex buffer (which contains the source vertex coordinates), as well as the destination mesh's vertex buffer. The destination mesh will receive the updated vertices as they are transformed. Once locked, you need to call UpdateSkinnedMesh, also specifying a series of transformation matrices (stored as D3DXMATRIX objects) that represent the various bone transformations.

For now, just check out the update_skin_mesh helper function code to see how it updates the skinned meshes for you.

HRESULT update_skin_mesh(D3DXMESHCONTAINER_EX* mesh_container)
{
    
if(mesh_container == NULL)
        
return E_FAIL;

    
if(mesh_container->MeshData.pMesh == NULL || mesh_container->skin_mesh == NULL || mesh_container->pSkinInfo == NULL)
        
return E_FAIL;

    
if(mesh_container->bone_matrices == NULL || mesh_container->frame_matrices == NULL)
        
return E_FAIL;

    
// copy the bone matrices over (must have been combined before call draw_mesh)
    for(DWORD i = 0; i < mesh_container->pSkinInfo->GetNumBones(); i++)
    {
        
// start with bone offset matrix
        mesh_container->bone_matrices[i] = *(mesh_container->pSkinInfo->GetBoneOffsetMatrix(i));

        
// apply frame transformation
        if(mesh_container->frame_matrices[i])
            mesh_container
->bone_matrices[i] *= (*mesh_container->frame_matrices[i]);
    }

    
void* src_vertices;
    
void* dest_vertices;

    mesh_container
->MeshData.pMesh->LockVertexBuffer(D3DLOCK_READONLY, (void**)&src_vertices);
    mesh_container
->skin_mesh->LockVertexBuffer(0, (void**)&dest_vertices);

    
// update the skinned mesh using provided transformations
    mesh_container->pSkinInfo->UpdateSkinnedMesh(mesh_container->bone_matrices, NULL, src_vertices, dest_vertices);

    mesh_container
->MeshData.pMesh->UnlockVertexBuffer();
    mesh_container
->skin_mesh->UnlockVertexBuffer();    

    
return S_OK;
}

 

Aside from the typical error−checking code, the update_skin_mesh function starts by looping through each bone contained within the ID3DXSkinInfo object (stored in the D3DXMESHCONTAINER_EX object you've already loaded). For each bone, the original transformation matrix from the .X file is grabbed and stored in an array of matrices used in the call to UpdateSkinnedMesh.

From here the bone's transformation, as stored in the bone's respective frame object, is applied to the transformation matrix. This process continues until all transformation matrices are set up

At this point, you are ready to lock the vertex buffers and call the UpdateSkinnedMesh function.

The function is finished by unlocking the buffers and returning a success code.

And once again speaking of rendering, it is finally time to see the helper functions I created to get those
meshes on screen!


posted on 2008-04-15 10:22 lovedday 閱讀(320) 評論(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>
            欧美视频亚洲视频| 蜜臀久久99精品久久久画质超高清| 黑人一区二区| 亚洲国产精品久久久久久女王| 亚洲激情欧美| 亚洲女同在线| 久久精品国产免费| 欧美不卡视频一区| 中文亚洲欧美| 久久激情五月丁香伊人| 久久精品国产99| 亚洲第一综合天堂另类专| 亚洲天堂第二页| 久久久久**毛片大全| 亚洲人成亚洲人成在线观看| 一区二区欧美在线| 久久久之久亚州精品露出| 亚洲国产精品一区在线观看不卡| 国产精品99久久久久久久女警| 欧美视频在线播放| 久久久精品日韩| 免费观看成人| 国产亚洲欧美一区| 亚洲天堂av在线免费观看| 亚洲男人的天堂在线aⅴ视频| 欧美国产日韩一区二区| 国产综合色精品一区二区三区| 亚洲愉拍自拍另类高清精品| 亚洲欧洲精品一区二区三区波多野1战4 | 欧美老女人xx| 精品不卡一区二区三区| 午夜天堂精品久久久久| 亚洲人体大胆视频| 国产精品专区第二| 亚洲自拍偷拍视频| 久久裸体艺术| 欧美激情一区二区三区在线视频观看| 黄色精品一区| 在线亚洲自拍| 亚洲精品中文在线| 欧美国产一区二区| 久久国产一区| 亚洲综合色丁香婷婷六月图片| 久久精品一区| 国产在线欧美日韩| 亚洲狼人综合| 国产精品www.| 欧美在线|欧美| 久久不射电影网| 亚洲主播在线| 欧美连裤袜在线视频| 免播放器亚洲一区| 国产一区二区在线免费观看| 一本色道久久综合精品竹菊| 欧美日韩一区二区三区免费看 | 国产精品mm| 亚洲第一精品夜夜躁人人躁| 久久久一二三| 久久黄色级2电影| 国产精品成人在线观看| 亚洲综合国产| 欧美午夜视频一区二区| 亚洲欧洲日产国码二区| 激情综合色丁香一区二区| 亚洲一区二区三区在线看 | 欧美日韩亚洲一区二| 亚洲国产精品久久| 亚洲区第一页| 亚洲网站在线观看| 狠狠色伊人亚洲综合成人| 亚洲欧美一级二级三级| 亚洲国产mv| 久久久久久自在自线| 免费成人在线观看视频| 伊人久久婷婷| 亚洲特黄一级片| 亚洲免费在线视频| 国产精品嫩草99av在线| 美女成人午夜| 亚洲欧洲精品一区二区精品久久久| 久久亚洲免费| 亚洲国产精品久久久久婷婷884 | 欧美一二三视频| 蜜桃久久av一区| 午夜免费电影一区在线观看| 国产精品久久久久久福利一牛影视 | 91久久精品国产91久久| 欧美福利精品| 中日韩高清电影网| 亚洲婷婷综合色高清在线| 国产精品免费福利| 欧美一区激情| 亚洲天堂偷拍| 国产亚洲一级| 欧美精品日日鲁夜夜添| 亚洲一区二区三区久久| 久久伊伊香蕉| 国产精品久久久久免费a∨| 亚洲综合视频1区| 免费在线欧美视频| 亚洲图片激情小说| 一区在线免费| 国产精品成人一区二区三区吃奶| 欧美一区二区三区四区在线 | 亚洲小视频在线| 欧美www视频| 欧美r片在线| 亚洲一区二区三区久久| 精品51国产黑色丝袜高跟鞋| 欧美精品18+| 欧美一级黄色网| 亚洲国产欧美日韩另类综合| 亚洲欧美日韩在线播放| 91久久国产自产拍夜夜嗨| 国产精品日韩在线| 亚洲国产精品悠悠久久琪琪| 国产精品美女久久久久久久| 久久精品国产亚洲aⅴ| 亚洲精品一级| 免费精品视频| 性久久久久久久久| 99re这里只有精品6| 欧美大片在线观看一区二区| 亚洲女人天堂av| 亚洲精品欧美日韩| 欧美mv日韩mv国产网站| 性亚洲最疯狂xxxx高清| 日韩亚洲精品电影| 亚洲黄色天堂| 国模 一区 二区 三区| 欧美午夜电影完整版| 欧美大片免费观看| 久久综合精品一区| 亚洲国产欧美不卡在线观看| 久久精品亚洲热| 午夜一区二区三视频在线观看| 99视频+国产日韩欧美| 欧美视频不卡| 欧美日韩国产在线| 亚洲自拍偷拍视频| 正在播放日韩| 9l视频自拍蝌蚪9l视频成人| 亚洲在线播放| 亚洲天堂激情| 亚洲图色在线| 亚洲天堂av图片| 亚洲一区二区三区高清 | 久久久久.com| 欧美伊人精品成人久久综合97| 亚洲人成人一区二区在线观看| 国产精品久久久久久久浪潮网站 | 亚洲欧洲一区二区三区| 亚洲国产精品久久久久秋霞不卡| 美女诱惑一区| 欧美激情精品久久久久久蜜臀| 免费永久网站黄欧美| 欧美成人免费大片| 亚洲麻豆视频| 宅男噜噜噜66国产日韩在线观看| 一个人看的www久久| 亚洲免费人成在线视频观看| 亚洲欧美激情视频在线观看一区二区三区 | 欧美日韩一区二区国产| 欧美婷婷久久| 国际精品欧美精品| 亚洲国产黄色片| 99国产精品| 午夜精品福利在线| 久久这里只有| 最新成人av在线| 亚洲综合欧美日韩| 久久久久久久性| 欧美日韩在线播放| 国产亚洲视频在线| 亚洲精品一级| 亚洲国产va精品久久久不卡综合| 亚洲人成人77777线观看| 中文精品一区二区三区| 久久久久国产精品人| 欧美gay视频激情| 一区二区三区免费观看| 久久久精品国产免费观看同学| 欧美精品日韩一本| 国产欧美一区二区白浆黑人| 欧美片在线观看| 国产日韩欧美高清免费| 国产精品理论片| 亚洲电影专区| 亚洲免费视频成人| 欧美激情小视频| 亚洲综合好骚| 欧美日本一道本| 好吊成人免视频| 亚洲一级片在线看| 欧美激情成人在线| 欧美在线一二三区| 国产精品二区三区四区| 亚洲国产成人在线视频| 久久久久www| 亚洲视频一区二区|