Question

I am just wondering how I can do the following code from Direct X 9 in Direct X 11? I know the MatrixRotationAxis and TransformCoord in Direct X 11 only takes in 2 parameters so I am not sure if it will work the same as the code below.

 D3DXMATRIX pitchMatrix;
 D3DXMatrixRotationAxis(&pitchMatrix, &right, pitch);
 D3DXVec3TransformCoord(&look, &look, &pitchMatrix); 
 D3DXVec3TransformCoord(&up, &up, &pitchMatrix);
Was it helpful?

Solution

It has nothing with DirectX version. It's about math libraries. After deprecation and stripping out D3DXMath from SDK we are forced to use DirectXMath or 3rd party math libraries instead.

See Living without D3DX for porting instructions.

Also, probably you will find this answer useful.

Edit: Worth to add that DirectXMath has specific alignment requirements. Make sure you don't overlook that (see: link)

Edit2: Specifically, XMMatrixRotationAxis accepts 2 parameters, because it returns result. With D3DXMatrixRotationAxis you expect result in third argument. See MSDN docs for details.

Hope this helps! Happy porting!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top