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

天行健 君子當自強而不息

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 閱讀(317) 評論(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>
            国产亚洲综合精品| 欧美国产在线观看| 欧美jizz19性欧美| 久久综合狠狠| 欧美激情一区二区三区全黄| 欧美大香线蕉线伊人久久国产精品| 久久久久国产精品厨房| 欧美在线视屏| 欧美大香线蕉线伊人久久国产精品| 亚洲黄色成人| 日韩视频在线永久播放| 亚洲一区二区视频在线| 久久久国产亚洲精品| 欧美成人精品h版在线观看| 欧美精品999| 国产精品进线69影院| 国产在线播精品第三| 亚洲国产精品传媒在线观看 | 欧美成人有码| 欧美精品免费在线观看| 国产美女诱惑一区二区| 亚洲欧洲日产国产综合网| 亚洲特色特黄| 欧美www视频在线观看| 亚洲午夜激情免费视频| 欧美成人一区二区在线| 国产亚洲精品久久久久久| 一本色道久久精品| 久久国产精品99久久久久久老狼| 亚洲第一色在线| 亚洲欧美日韩在线不卡| 欧美精品1区2区3区| 国产一区二区精品在线观看| 99亚洲伊人久久精品影院红桃| 久久久久久香蕉网| av成人免费观看| 蜜臀久久久99精品久久久久久| 国产精品国产自产拍高清av| 亚洲国产精品嫩草影院| 久久精品一区| 亚洲免费在线视频| 欧美韩日一区二区| 亚洲国产欧美一区二区三区久久| 欧美在线三级| 一区二区精品在线| 欧美成人黄色小视频| 亚洲一区制服诱惑| 欧美日韩中文在线| 日韩亚洲欧美中文三级| 六十路精品视频| 欧美在线你懂的| 国产美女一区二区| 亚洲欧美综合精品久久成人| 亚洲激情在线视频| 免费成人av在线| 激情综合网激情| 久热精品视频| 久久一区国产| 在线不卡亚洲| 欧美高清不卡| 欧美国产日韩精品免费观看| 精品1区2区3区4区| 久热国产精品| 久久综合狠狠综合久久激情| 一区二区在线视频播放| 久久三级福利| 久久亚洲欧美| 亚洲精品中文字幕女同| 亚洲激情在线观看视频免费| 欧美va天堂在线| 亚洲肉体裸体xxxx137| 欧美国产日韩一区二区在线观看| 久久影视精品| 99精品热视频只有精品10| 欧美激情一区二区三区全黄| 欧美裸体一区二区三区| 亚洲免费视频一区二区| 亚洲午夜一区二区| 国产永久精品大片wwwapp| 蜜桃av噜噜一区| 蜜臀99久久精品久久久久久软件| 99精品视频免费观看| 亚洲少妇中出一区| 国产欧美日韩视频在线观看| 欧美黑人在线观看| 欧美色精品天天在线观看视频| 欧美亚洲综合另类| 久久亚洲色图| 午夜日韩在线| 久久噜噜噜精品国产亚洲综合| 亚洲国产天堂久久综合| 在线视频精品| 亚洲国产电影| 亚洲欧美另类在线观看| 最新中文字幕亚洲| 亚洲专区国产精品| 影音先锋久久精品| 一本久道久久综合狠狠爱| 国产真实乱偷精品视频免| 亚洲国产成人精品久久| 国产精品色一区二区三区| 亚洲电影免费观看高清完整版| 国产精品sss| 免费国产自线拍一欧美视频| 欧美日本视频在线| 免费h精品视频在线播放| 欧美视频中文字幕在线| 久久精品在线观看| 一本久道综合久久精品| 国产亚洲亚洲| 91久久国产综合久久| 国产亚洲欧美一区在线观看| 亚洲美女在线视频| 在线日本欧美| 午夜精品久久久久久久蜜桃app| 亚洲欧洲一区二区三区| 香蕉久久夜色精品| 亚洲香蕉伊综合在人在线视看| 久久精品亚洲精品国产欧美kt∨| 中文在线资源观看网站视频免费不卡 | 毛片一区二区| 久久成人国产| 国产精品免费福利| 一区二区三区产品免费精品久久75 | 欧美一区二区三区在线观看 | 美日韩精品免费观看视频| 国产精品久久影院| 一区二区三区日韩欧美| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 国产精品伦一区| 亚洲免费高清视频| 日韩香蕉视频| 欧美福利视频在线观看| 欧美风情在线观看| 亚洲国产91| 免费久久久一本精品久久区| 蜜臀av性久久久久蜜臀aⅴ| 国内精品伊人久久久久av影院| 亚洲免费影院| 久久久久久婷| 伊人久久噜噜噜躁狠狠躁| 久久精品免费播放| 欧美国产日产韩国视频| 亚洲国产专区校园欧美| 裸体女人亚洲精品一区| 欧美凹凸一区二区三区视频| 影音先锋久久精品| 欧美成人免费网| 亚洲福利视频三区| 99re8这里有精品热视频免费| 欧美精品三级在线观看| 一区二区三区 在线观看视| 一区二区三区四区国产精品| 国产精品成人在线| 久久综合久久综合这里只有精品| 国产精品网站一区| 翔田千里一区二区| 欧美国产欧美综合| 99亚洲一区二区| 国产精品女同互慰在线看| 午夜国产一区| 欧美激情亚洲另类| 亚洲欧美日韩在线观看a三区 | 国产精品久久久久久久久果冻传媒 | 欧美国产精品人人做人人爱| 亚洲三级视频| 欧美一级片久久久久久久| 国语精品中文字幕| 欧美激情91| 亚洲欧美美女| 欧美国产乱视频| 亚洲影院在线| 很黄很黄激情成人| 欧美另类99xxxxx| 亚洲欧美一区二区三区久久| 欧美成人a∨高清免费观看| 一卡二卡3卡四卡高清精品视频| 国产精品毛片va一区二区三区| 久久爱www久久做| 亚洲精品一级| 久久中文久久字幕| 亚洲综合不卡| 精品盗摄一区二区三区| 欧美视频一区| 欧美成人日本| 久久噜噜亚洲综合| 午夜精品99久久免费| 亚洲精品国产精品国产自| 久久成人18免费网站| 一本综合久久| 亚洲国产高清一区二区三区| 国产精品草莓在线免费观看| 久久久国产精品一区二区中文 | 美女免费视频一区| 亚洲欧美变态国产另类| 亚洲激情av| 欧美福利影院| 久久综合色88| 欧美一区日韩一区| 欧美一级淫片aaaaaaa视频|