3D 장면을 만들 때 방금 큐브 개체를 삽입했습니다. 기원은 괜찮아 보이지만 회전 시키려고 할 때 커다란 변형 큐브가 생깁니다. 여기에 내 코드에서 문제 영역이다 : 나는 그것이 나에게 문제를주고 트랜스의 cubeMOVE 부분의 것을 발견했다DirectX11 - Matrix Translation
D3DXMATRIX cubeROT, cubeMOVE;
D3DXMatrixRotationY(&cubeROT, D3DXToRadian(45.0f));
D3DXMatrixTranslation(&cubeMOVE, 10.0f, 2.0f, 1.0f);
D3DXMatrixTranspose(&worldMatrix, &(cubeROT * cubeMOVE));
// Put the model vertex and index buffers on the graphics pipeline to prepare them for drawing.
m_Model->Render(m_Direct3D->GetDeviceContext());
// Render the model using the light shader.
result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_Model->GetTexture(), m_Light->GetDirection(), m_Light->GetDiffuseColor());
// Reset the world matrix.
m_Direct3D->GetWorldMatrix(worldMatrix);
는하지만 난 왜 아무 생각이 없습니다. 이 제대로 큐브 변환
D3DXMatrixTranspose(&worldMatrix, &cubeROT);
:
D3DXMatrixTranslation(&worldMatrix, 10.0f, 2.0f, 1.0f);
을하지만이 변형 된 메쉬 생성 :
D3DXMatrixTranspose(&worldMatrix, &cubeMOVE);
나는 아주 새로운 해요를이 제대로 큐브를 회전
DirectX를 사용하면 도움이 될 것입니다.
완전히 맞습니다. D3DXMatrixMultiply 대신 D3DXMatrixTranspose를 사용했습니다. 감사합니다! –