2eme cube test + lock vertical camera

This commit is contained in:
StratiX0 2024-04-02 12:58:28 +02:00
parent 2224c87468
commit fd0ae3aa25
2 changed files with 21 additions and 2 deletions

View File

@ -780,6 +780,25 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
return false;
}
scaleMatrix = XMMatrixScaling(1.0f, 1.0f, 1.0f); // Build the scaling matrix.
rotateMatrix = XMMatrixRotationY(40); // Build the rotation matrix.
translateMatrix = XMMatrixTranslation(0, 5.0f, -10.0f); // Build the translation matrix.
// Multiply the scale, rotation, and translation matrices together to create the final world transformation matrix.
srMatrix = XMMatrixMultiply(scaleMatrix, rotateMatrix);
worldMatrix = XMMatrixMultiply(srMatrix, translateMatrix);
// Render the model using the multitexture shader.
m_Model->Render(m_Direct3D->GetDeviceContext());
//Normal Mapping
result = m_NormalMapShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_Model->GetTexture(0), m_Model->GetTexture(1), m_Light->GetDirection(), m_Light->GetDiffuseColor());
if (!result)
{
return false;
}
// Enable the Z buffer and disable alpha blending now that 2D rendering is complete.
m_Direct3D->TurnZBufferOn();
m_Direct3D->DisableAlphaBlending();

View File

@ -236,10 +236,10 @@ void InputClass::ProcessInput()
//// Ensure the mouse location doesn't exceed the screen width or height.
//if (m_mouseX < 0) { m_mouseX = 0; }
//if (m_mouseY < 0) { m_mouseY = 0; }
if (m_mouseY < -m_screenHeight) { m_mouseY = -m_screenHeight; }
//if (m_mouseX > m_screenWidth) { m_mouseX = m_screenWidth; }
//if (m_mouseY > m_screenHeight) { m_mouseY = m_screenHeight; }
if (m_mouseY > m_screenHeight) { m_mouseY = m_screenHeight; }
return;
}