pull/4/head
Elias Almqvist 2 years ago
parent cd0b229767
commit 6c1349b526
  1. 3
      headers/renderer.hpp
  2. 6
      src/main.cpp

@ -18,6 +18,8 @@
#define NEAR_PLANE 0.1f #define NEAR_PLANE 0.1f
#define FAR_PLANE 100.0f #define FAR_PLANE 100.0f
#define CAM_SPEED 0.05f
namespace Renderer { namespace Renderer {
class Object { class Object {
public: public:
@ -58,6 +60,7 @@ namespace Renderer {
glm::mat4 view = glm::mat4(1.0f); glm::mat4 view = glm::mat4(1.0f);
private: private:
GLFWwindow* window; GLFWwindow* window;
// glm::vec3 front = glm::vec3(0.0f, 0.0f, -1.0f);
}; };

@ -177,12 +177,12 @@ int main() {
// scene.camera.setRotation(glm::vec3(gVal * 5, 5.0f * gVal, gVal * 20.0f)); // scene.camera.setRotation(glm::vec3(gVal * 5, 5.0f * gVal, gVal * 20.0f));
// scene.camera.translate(glm::vec3(0.0f, 0.0f, 0.02f + gVal/100.0f)); // scene.camera.translate(glm::vec3(0.0f, 0.0f, 0.02f + gVal/100.0f));
scene.camera.pointAt(glm::vec3(0.0f, 0.0f, 0.0f)); scene.camera.pointAt(glm::vec3(0.0f, 0.0f, 0.0f));
scene.camera.setPosition(glm::vec3(cos(time)*10.0f, 0.0f, gVal*10.0f)); float radius = 10.0f;
scene.camera.setPosition(glm::vec3(cos(time) * radius, 0.0f, sin(time) * radius));
// Move the objects & stuff // Move the objects & stuff
float rotang = time; float rotang = time;
ro.rotate(glm::vec3(0.0f, 0.0f, gVal)); ro.rotate(glm::vec3(gVal, 0.0f, gVal));
ro2.setPosition(glm::vec3(0.0f, gVal * 2.0f, 1.0f + gVal*5.0f)); ro2.setPosition(glm::vec3(0.0f, gVal * 2.0f, 1.0f + gVal*5.0f));
// Render new frame // Render new frame

Loading…
Cancel
Save