D3DXVECTOR3 dest(mesh1->posX, mesh1->posY, mesh1->posZ);
D3DXVECTOR3 src(mesh2->posX, mesh2->posY, mesh2->posZ);
D3DXVECTOR3 distance = dest - src;
D3DXMatrixRotationYawPitchRoll(&matRotation, Yaw, Pitch, Roll); // Change this line for rotation
Thanks,