Hi guys
I’m stuck with a problem trying to convert Assimp’s aiMatrix4x4 to a D3DXMATRIX since I’m using DirectX. I do not want to use the aiMatrix4x4 because my whole engine uses the D3DXMATRIX.
Thanks in advance.
How to convert aiMatrix4x4 to D3DXMATRIX?
Page 1 of 15 Replies - 2146 Views - Last Post: 16 October 2013 - 02:35 AM
Replies To: How to convert aiMatrix4x4 to D3DXMATRIX?
#2
Re: How to convert aiMatrix4x4 to D3DXMATRIX?
Posted 15 October 2013 - 11:59 AM
Surely it's simple enough to grab the values from the aiMatrix4x4 and set them into your D3DXMATRIX? They are both matrices after all.
Construct your D3DXMATRIX using the values from the aiMatrix4x4. One D3DXMATRIX constructor takes a pointer to floats.
Construct your D3DXMATRIX using the values from the aiMatrix4x4. One D3DXMATRIX constructor takes a pointer to floats.
D3DXMATRIX( CONST FLOAT * );
#3
Re: How to convert aiMatrix4x4 to D3DXMATRIX?
Posted 15 October 2013 - 01:00 PM
Hi.
Thank you for your answer stayscript. I had some includes missing but it is all sorted out now.
I don’t know the exact reason but when I tried, like you suggested, I got a constant error. This was the code:
The compiler complained about .a1 cannot be found. I included "matrix4x4" and all is fine.
Thanks again.
Thank you for your answer stayscript. I had some includes missing but it is all sorted out now.
I don’t know the exact reason but when I tried, like you suggested, I got a constant error. This was the code:
const aiMatrix4x4 pMatrix = paiMesh->mBones[i]->mOffsetMatrix; D3DXMATRIX PMatrix; PMatrix(0,0) = pMatrix.a1;
The compiler complained about .a1 cannot be found. I included "matrix4x4" and all is fine.
Thanks again.
#4
Re: How to convert aiMatrix4x4 to D3DXMATRIX?
Posted 16 October 2013 - 01:21 AM
Your code isn't really what I was suggesting, i suggested that you pass in the array of floats from the aiMatrix4x4 and use them to construct the D3DXMATRIX
Something like the following:
Glad you got it working though
Something like the following:
D3DXMATRIX PMatrix(&paiMesh->mBones[i]->mOffsetMatrix[0]);
Glad you got it working though

#5
Re: How to convert aiMatrix4x4 to D3DXMATRIX?
Posted 16 October 2013 - 02:20 AM
Hi styscript.
Thank you for your idea. Never thought of it. I’ll surely implement it. Its mush better.
Thanks again
Thank you for your idea. Never thought of it. I’ll surely implement it. Its mush better.
Thanks again
#6
Re: How to convert aiMatrix4x4 to D3DXMATRIX?
Posted 16 October 2013 - 02:35 AM
No problem.
Page 1 of 1