Prepare Global Variables
main.cpp
glm::vec3 lightPos = glm::vec3(5.0f, 5.0f, 10.0f);
glm::vec3 viewPos = glm::vec3(0.0f, 0.0f, 5.0f); // set the eye at (0, 0, 5), looking at the centre of the world
// try to change the eye position
// viewPos = glm::vec3(0.0f, 0.0f, 5.0f);
matView = glm::lookAt(viewPos, glm::vec3(0, 0, 0), glm::vec3(0, 1, 0)); GLuint blinnShader;
GLuint phongShader;static Shader shader;
glm::mat4 matModelRoot = glm::mat4(1.0);
glm::mat4 matView = glm::mat4(1.0);
glm::mat4 matProj = glm::ortho(-2.0f,2.0f,-2.0f,2.0f, -2.0f,2.0f);
glm::vec3 lightPos = glm::vec3(5.0f, 10.0f, 20.0f);
glm::vec3 viewPos = glm::vec3(0.0f, 0.0f, 10.0f);
GLuint blinnShader;
GLuint phongShader;Last updated