-};
-
-void drawPyramids(float d, glm::vec3 lightPos, glm::vec4 lightColor) {
- glUseProgram(gradientProgId);
- glBindVertexArray(pyramidVao);
- setProjectionAndViewUniforms(gradientProgId);
-
- setLightColorAndPos(gradientProgId, lightPos, lightColor);
-
- GLuint modelId = glGetUniformLocation(gradientProgId, "model");
-
- for (int i = 0; i < 10; i++) {
-
- glm::mat4 model = glm::mat4(1.f);
-
- model = glm::translate(model, glm::vec3(sin(i * 30) * 10, 0, i * 2 - 10));
-
- if (doRotate) {
- model = glm::rotate(model, d * glm::radians(30.f), glm::vec3(0.f, 1.f, 0.f));
- model = glm::rotate(model, d * glm::radians(20.f), glm::vec3(1.f, 0.f, 0.f));
- }
-
- if (doScale)
- model = glm::scale(model, glm::vec3(1.f, 0.7f + 0.7f * (1 + sin(d + (i + 3))), 1.f));
-
- if (doTranslate)
- model = glm::translate(model, glm::vec3(sin(d + (i + 1)), cos(d + (i + -3)), sin(d + (i + 4))));
-
-
- glUniformMatrix4fv(modelId, 1, GL_FALSE, glm::value_ptr(model));
-
- glDrawArrays(GL_TRIANGLES, 0, 18);
- }
-
-};
-
-enum TeapotProjection { teapotOrtho, teapotCamera, teapotPerspStatic, teapotPerspAnimated };
-
-void drawTeapot(TeapotProjection proj, bool rotate, float d, glm::vec3 lightPos, glm::vec4 lightColor) {
- glUseProgram(normalProgId);
-
- GLuint projLoc = glGetUniformLocation(normalProgId, "projection");
- GLuint viewLoc = glGetUniformLocation(normalProgId, "view");
- switch (proj) {
- case teapotCamera:
- setProjectionAndViewUniforms(normalProgId);
- break;
- case teapotOrtho:
- {
- glm::mat4 proj = glm::ortho(-5.f * ASPECT, 5.f * ASPECT, -5.f, 5.f, 0.01f, 1000.f);
- glUniformMatrix4fv(projLoc, 1, GL_FALSE, glm::value_ptr(proj));
-
- glm::vec3 camPos(-5, 5, -5), camFront = glm::vec3(0) - camPos;
- glm::mat4 view = glm::lookAt(camPos, camPos + camFront, camUp);
- glUniformMatrix4fv(viewLoc, 1, GL_FALSE, glm::value_ptr(view));