this is the render loop:
I draw only 2 meshes of the 200 meshes vector m_AllMeshes
for(itMesh = m_AllMeshes.begin();itMesh != m_AllMeshes.end();itMesh++) { Device->SetMaterial(&mtrl); CMeshBase* pmesh=((CMeshBase*)*itMesh); if(pmesh->getName().find("F430-mesh")!=string::npos ) { vRotationAxis->x = 0.57735f; vRotationAxis->y = 0.57735f; vRotationAxis->z = 0.57735f; matr->LoadIdentity(); matr->RotateAxis(vRotationAxis,-240); matr->Translate(0.642309f,-0.1489442f,0.442514f); matr->Push(); Device->SetTransform(D3DTS_WORLDMATRIX(0), matr->GetTop()); pmesh->mesh->DrawSubset(0); } if(pmesh->getName().find("B-floor-mesh")!=string::npos) { matr->LoadIdentity(); matr->RotateAxis(vRotationAxis,-240); matr->Translate(0.234062f, -1.04631f,0.148801f); matr->Push(); Device->SetTransform(D3DTS_WORLDMATRIX(0), matr->GetTop()); pmesh->mesh->DrawSubset(0); } }
I call loadidentity before apply the transform and the rotation result is ok ,but there is an error in the location of the 2 meshes
i already test that the values of the translate is correct.
I must use translate or translatelocal?
thanks.