Compare commits

...

2 Commits

Author SHA1 Message Date
Archie Hilton 06e7e308cc main: Add another useless quad 2024-05-26 21:53:20 +01:00
Archie Hilton a65885d2bf quad: Actually use the rotation member 2024-05-26 21:53:12 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -37,9 +37,8 @@ void Quad::draw(GLFWwindow *w) {
glm::mat4 translate = glm::mat4 translate =
glm::translate(glm::mat4(1.0f), glm::vec3(m_pos_x, m_pos_y, 0.0f)); glm::translate(glm::mat4(1.0f), glm::vec3(m_pos_x, m_pos_y, 0.0f));
glm::mat4 rotate = glm::mat4 rotate = glm::rotate(glm::mat4(1.0f), glm::radians(m_rotation),
glm::rotate(glm::mat4(1.0f), (float)glfwGetTime() * glm::radians(50.0f), glm::vec3(0.0f, 0.0f, 1.0f));
glm::vec3(0.0f, 0.0f, 1.0f));
glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(1.0f)); glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(1.0f));
glm::mat4 model = translate * rotate * scale; glm::mat4 model = translate * rotate * scale;
glm::mat4 view = glm::mat4(1.0f); glm::mat4 view = glm::mat4(1.0f);

View File

@ -117,10 +117,13 @@ static void init_opengl() {
init_shaders(); init_shaders();
quads.push_back(new Quad(std::span<float>(verts), uniform_locations));
quads.push_back(new Quad(std::span<float>(verts), uniform_locations)); quads.push_back(new Quad(std::span<float>(verts), uniform_locations));
quads[0]->m_pos_y = 40; quads[0]->m_pos_y = 40;
quads[0]->m_pos_x = 40; quads[0]->m_pos_x = 40;
quads[1]->m_pos_y = 40;
quads[1]->m_pos_x = 400;
} }
int main() { int main() {