|
|
@ -28,8 +28,8 @@ void processInput(GLFWwindow *win) { |
|
|
|
void renderCallback() { |
|
|
|
void renderCallback() { |
|
|
|
// Make background
|
|
|
|
// Make background
|
|
|
|
// glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
|
|
|
|
// glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
|
|
|
|
glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
|
|
|
// glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
|
|
|
// glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -157,11 +157,11 @@ int main() { |
|
|
|
Renderer::TexturedObject ro2(verts, indices); |
|
|
|
Renderer::TexturedObject ro2(verts, indices); |
|
|
|
ro2.setPosition(glm::vec3(0.5f, 0.0, -8.0f)); |
|
|
|
ro2.setPosition(glm::vec3(0.5f, 0.0, -8.0f)); |
|
|
|
|
|
|
|
|
|
|
|
ro.setTexture(RUSTY_METAL_TEXTURE); |
|
|
|
|
|
|
|
ro2.setTexture("assets/textures/meep.jpg"); |
|
|
|
ro2.setTexture("assets/textures/meep.jpg"); |
|
|
|
|
|
|
|
ro.setTexture(RUSTY_METAL_TEXTURE); |
|
|
|
|
|
|
|
|
|
|
|
scene.spawnObject(ro); |
|
|
|
scene.spawnObject(&ro); |
|
|
|
// scene.spawnObject(ro2);
|
|
|
|
scene.spawnObject(&ro2); |
|
|
|
|
|
|
|
|
|
|
|
while (!glfwWindowShouldClose(win)) { |
|
|
|
while (!glfwWindowShouldClose(win)) { |
|
|
|
// Handle input
|
|
|
|
// Handle input
|
|
|
@ -174,17 +174,12 @@ int main() { |
|
|
|
float gVal = sin(time); |
|
|
|
float gVal = sin(time); |
|
|
|
|
|
|
|
|
|
|
|
// Move the camera left and right
|
|
|
|
// Move the camera left and right
|
|
|
|
// scene.camera.setPosition(glm::vec3(0.0f, 0.0f, 8*gVal-4.0f));
|
|
|
|
|
|
|
|
// scene.camera.translate(glm::vec3(0.0f, 0.0f, 0.01f));
|
|
|
|
|
|
|
|
scene.camera.setRotation(glm::vec3(0.0f, 5.0f, 0.0f)); |
|
|
|
scene.camera.setRotation(glm::vec3(0.0f, 5.0f, 0.0f)); |
|
|
|
// scene.camera.rotate(glm::vec3(0.0f, -0.4f, 0.0f));
|
|
|
|
scene.camera.translate(glm::vec3(0.0f, 0.0f, 0.02f + gVal/100.0f)); |
|
|
|
|
|
|
|
|
|
|
|
// Move the objects & stuff
|
|
|
|
// Move the objects & stuff
|
|
|
|
float rotang = time; |
|
|
|
float rotang = time; |
|
|
|
// ro.setRotation(glm::vec3(time*10, 0.0f, time));
|
|
|
|
ro.translate(glm::vec3(0.0f, 0.0f, -0.021f)); |
|
|
|
// ro.translate(glm::vec3(0.0f, 0.0f, -0.015f));
|
|
|
|
|
|
|
|
ro.setPosition(glm::vec3(10.0f, 0.0f, 0.0f)); |
|
|
|
|
|
|
|
// ro.rotate(glm::vec3(20.0f, 0.0f, 0.0f));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Render new frame
|
|
|
|
// Render new frame
|
|
|
|
scene.render(); |
|
|
|
scene.render(); |
|
|
|