mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Update GLM to latest version (0.9.9.3). This includes GLM's change of matrices no longer default initializing to the identity matrix. This commit thus also includes the update of all of LearnOpenGL's code to reflect this: all matrices are now constructor-initialized to the identity matrix where relevant.
This commit is contained in:
@@ -127,7 +127,7 @@ int main()
|
||||
shader.setMat4("projection", projection);
|
||||
shader.setMat4("view", view);
|
||||
// render parallax-mapped quad
|
||||
glm::mat4 model;
|
||||
glm::mat4 model = glm::mat4(1.0f);
|
||||
model = glm::rotate(model, glm::radians((float)glfwGetTime() * -10.0f), glm::normalize(glm::vec3(1.0, 0.0, 1.0))); // rotate the quad to show parallax mapping from multiple directions
|
||||
shader.setMat4("model", model);
|
||||
shader.setVec3("viewPos", camera.Position);
|
||||
@@ -143,7 +143,7 @@ int main()
|
||||
renderQuad();
|
||||
|
||||
// render light source (simply re-renders a smaller plane at the light's position for debugging/visualization)
|
||||
model = glm::mat4();
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, lightPos);
|
||||
model = glm::scale(model, glm::vec3(0.1f));
|
||||
shader.setMat4("model", model);
|
||||
|
||||
Reference in New Issue
Block a user