Hello to all again.
At last I implement taking out all rotations, translation and scaling. and do as said hossainiir, but It doesn`t work correctly.
If I use single matrix - scene load correctly, but if not - meshes displays not on their places as they was in 3d max originally.
On screen I use can see original 3s max scene in front.
on screen2 - scene after loading without single matrix
on screen3 displays the same scene WITH single matrix
on screen4 - you can see another one problem which I didn`t mention yet. When I begin rotation of mesh it loose its scaling and became exactly the same as it was before I use scaling in 3ds max and in addition it becomes very small. I actually export with millimeters, but I think that small size is not the real problem . Real problem is that mesh loose its form.
So, I have 2 problems.
Here is some code to show how I use matrices.
float x = 0;
float y = 0;
float z = 0;
file.read((char*)&x,sizeof(float));
file.read((char*)&y,sizeof(float));
file.read((char*)&z,sizeof(float));
XMMATRIX scale = XMMatrixScaling(x, y, z);
file.read((char*)&x,sizeof(float));
file.read((char*)&y,sizeof(float));
file.read((char*)&z,sizeof(float));
XMMATRIX rotationX = XMMatrixRotationX(x);
XMMATRIX rotationY = XMMatrixRotationY(y);
XMMATRIX rotationZ = XMMatrixRotationZ(z);
file.read((char*)&x,sizeof(float));
file.read((char*)&y,sizeof(float));
file.read((char*)&z,sizeof(float));
XMMATRIX translation = XMMatrixTranslation(x, y, z);
meshInfo->meshPosition = scale * rotationX * rotationY * rotationZ * translation;
After that I made the following to translate Y_UP 3s max right hand coordinate system to Y_UP left hand coordinate system in DirectX
XMFLOAT4X4 cm;
cm._11 = 1;
cm._12 = 0;
cm._13 = 0;
cm._14 = 0;
cm._21 = 0;
cm._22 = 0;
cm._23 = 1;
cm._24 = 0;
cm._31 = 0;
cm._32 = 1;
cm._33 = 0;
cm._34 = 0;
cm._41 = 0;
cm._42 = 0;
cm._43 = 0;
cm._44 = 1;
XMMATRIX axisZ_UPtoY_UP = XMLoadFloat4x4(&cm);
XMMATRIX scale = XMMatrixScaling(1.0f, 1.0f, -1.0f);
meshInfo->meshPosition = axisZ_UPtoY_UP*meshInfo->meshPosition;
meshInfo->meshPosition = meshInfo->meshPosition*scale;
and then I load geometry
for (int i = 0; i<meshesList[index]->vertexCount; i++)
{
vertices.position = XMFLOAT3(meshesList[index]->meshType.x, meshesList[index]->meshType.z, -meshesList[index]->meshType.y);
vertices.texture = XMFLOAT2(1-meshesList[index]->meshType.tu, 1-meshesList[index]->meshType.tv);
vertices.normal = XMFLOAT3(meshesList[index]->meshType.nx, meshesList[index]->meshType.nz, -meshesList[index]->meshType.ny);
}
Thats all. Could anyone tell me what I am doing wrong here?