1 2 3 4 5 6 7 8 9 10 11 12 13
| for (unsigned int i = 0; i < 10; i++) { glm::mat4 model; model = glm::translate(model, cubePositions[i]); float angle = 0.0f; if (i % 3 == 0) { angle = i * ((360.0f * sin(glfwGetTime()) / 2) + 0.5f); } model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.3f, 0.5f)); glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glDrawArrays(GL_TRIANGLES, 0, 36); }
|