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:
@@ -191,25 +191,25 @@ int main()
|
||||
// RED
|
||||
glBindVertexArray(cubeVAO);
|
||||
shaderRed.use();
|
||||
glm::mat4 model;
|
||||
glm::mat4 model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(-0.75f, 0.75f, 0.0f)); // move top-left
|
||||
shaderRed.setMat4("model", model);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||
// GREEN
|
||||
shaderGreen.use();
|
||||
model = glm::mat4();
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(0.75f, 0.75f, 0.0f)); // move top-right
|
||||
shaderGreen.setMat4("model", model);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||
// YELLOW
|
||||
shaderYellow.use();
|
||||
model = glm::mat4();
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(-0.75f, -0.75f, 0.0f)); // move bottom-left
|
||||
shaderYellow.setMat4("model", model);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||
// BLUE
|
||||
shaderBlue.use();
|
||||
model = glm::mat4();
|
||||
model = glm::mat4(1.0f);
|
||||
model = glm::translate(model, glm::vec3(0.75f, -0.75f, 0.0f)); // move bottom-right
|
||||
shaderBlue.setMat4("model", model);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||
|
||||
Reference in New Issue
Block a user