how to convert XMMATRIX to D3DMATRIX in DirectX 9?

早过忘川 提交于 2019-12-02 03:35:57

You can use XMStoreFloat4x4 to convert XMMATRIX to a XMFLOAT4X4.

You should be able to pass in XMFLOAT4X4 to setTransform by casting.

DirectX::XMMATRIX matProjection;   
DirectX::XMFLOAT4X4 projectionMatrix;
DirectX::XMMatrixPerspectiveFovLH(&matProjection,DirectX::XMConvertToRadians(45),1.0f,100.0f); 
XMStoreFloat4x4(&projectionMatrix, matProjection);
d3ddev->SetTransform(D3DTS_PROJECTION, (D3DXMATRIX*)&projectionMatrix);  /*problem!*/   // set the projection
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!