this is a pretty strange result.
the number displayed seems to be ok.
but with equal operation,it returns false.
i don't know what is going on here.need some help.
#include <stdio.h>
#include <d3dx9.h>
int main()
{
D3DXMATRIX m1,m2,m3,m4;
D3DXMatrixRotationY(&m1,0.1f);
D3DXMatrixRotationY(&m2,0.1f);
m3=m1*m2;
D3DXMatrixRotationY(&m4,0.2f);
for(int i=0; i<4; ++i)
{
for(int j = 0; j<4; ++j)
{
if(m3(i, j) == m4(i, j))
{
printf("(%d,%d) equal\n",i,j);
}
else
{
printf("(%d,%d) not equal!!!!\n",i,j);
printf("(m3 = %f, m4 = %f) not equal!!!!\n",m3(i,j),m4(i,j));
}
}
}
return 0;
}
console result
(0,0) equal
(0,1) equal
(0,2) not equal!!!!
(m3 = -0.198669, m4 = -0.198669) not equal!!!!
(0,3) equal
(1,0) equal
(1,1) equal
(1,2) equal
(1,3) equal
(2,0) not equal!!!!
(m3 = 0.198669, m4 = 0.198669) not equal!!!!
(2,1) equal
(2,2) equal
(2,3) equal
(3,0) equal
(3,1) equal
(3,2) equal
(3,3) equal