Camera and shader now fixed up.
This commit is contained in:
parent
47bd233722
commit
a7beb5a92a
5 changed files with 60 additions and 53 deletions
|
|
@ -224,7 +224,7 @@ Config setup() {
|
|||
void draw_models(Config& config, size_t model_i, size_t model_pos, glm::mat4& projection, glm::mat4& view)
|
||||
{
|
||||
glm::vec3 objectColor = {1.0, 0.94, 0.78};
|
||||
config.shader.applyMaterial(config.cubeMaterial);
|
||||
config.shader.apply_material(config.cubeMaterial);
|
||||
|
||||
float time = glfwGetTime();
|
||||
glm::mat4 model = glm::mat4(1.0f);
|
||||
|
|
@ -247,7 +247,7 @@ void render(GLFWwindow* window, Config& config) {
|
|||
|
||||
config.camera.update(config.deltaTime);
|
||||
|
||||
glm::mat4 view = config.camera.lookAt();
|
||||
glm::mat4 view = config.camera.look_at();
|
||||
glm::mat4 projection = glm::mat4(1.0f);
|
||||
|
||||
// fov, aspect, near plane, far plane
|
||||
|
|
@ -260,7 +260,7 @@ void render(GLFWwindow* window, Config& config) {
|
|||
|
||||
config.light.spot.position = config.camera.pos;
|
||||
config.light.spot.direction = config.camera.front;
|
||||
config.shader.applyLighting(config.light);
|
||||
config.shader.apply_lighting(config.light);
|
||||
|
||||
for(size_t i = 0; i < CUBE_COUNT; i++) {
|
||||
draw_models(config, 0, i, projection, view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue