Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _view = glm::translate(_view, {0.f, 0.f, -3.f});
- _projection = glm::perspective(glm::radians(FOV), (float)size.x / (float)size.y, 0.1f, 100.f);
- glUniformMatrix4fv(
- glGetUniformLocation(states.shader->ID, "model"),
- 1, GL_FALSE, glm::value_ptr(states.transform.getMatrix())
- );
- glUniformMatrix4fv(
- glGetUniformLocation(states.shader->ID, "view"),
- 1, GL_FALSE, glm::value_ptr(_view)
- );
- glUniformMatrix4fv(
- glGetUniformLocation(states.shader->ID, "projection"),
- 1, GL_FALSE, glm::value_ptr(_projection)
- );
- SHADER---
- #version 330 core
- layout (location = 0) in vec3 aPos;
- layout (location = 1) in vec3 aColor;
- layout (location = 2) in vec2 aTexCoord;
- out vec3 ourColor;
- out vec2 texCoord;
- uniform mat4 model;
- uniform mat4 view;
- uniform mat4 projection;
- void main()
- {
- gl_Position = projection * view * model * vec4(aPos, 1.0);
- texCoord = aTexCoord;
- ourColor = aColor;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement