|
|

楼主 |
发表于 2006-3-31 23:43:00
|
显示全部楼层
Re:为什么不能同步的移动摄影机和Mesh
我照楼上这么移动的对不,我试了可屏幕还是移动了,我希望按下 A D时一动不动。
就表示摄影机和模型都动了。
HRESULT CMyD3DApplication::AffineVerse(D3DXMATRIX m)
{
float temp[16];
memcpy(temp, m, 16 * sizeof(float));
m[4] = temp[1];
m[1] = temp[4];
m[8] = temp[2];
m[2] = temp[8];
m[9] = temp[6];
m[6] = temp[9];
m[12] = -(temp[0]*temp[12] + temp[1]*temp[13] + temp[2]*temp[14]);
m[13] = -(temp[4]*temp[12] + temp[5]*temp[13] + temp[6]*temp[14]);
m[14] = -(temp[8]*temp[12] + temp[9]*temp[13] + temp[10]*temp[14]);
return S_OK;
}
//移动世界
D3DXMatrixTranslation(&matMoveWorld,m_MoveWorld,0.0f,0.0f);
m_pd3dDevice->SetTransform(D3DTS_WORLD,&matMoveWorld);
m_pd3dDevice->GetTransform(D3DTS_VIEW,&matMoveWorld);
AffineVerse(matMoveWorld);
m_pMeshT1->DrawSubset(0); |
|