You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
638 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #include "scene.h"
  2. #include "ggl.h"
  3. #include "utils.h"
  4. #include "ground.h"
  5. #include "model.h"
  6. glm::mat4 modelMatrix, viewMatrix, projectionMatrix;
  7. Ground ground;
  8. Model model;
  9. void Init() {
  10. ground.Init();
  11. model.Init("Res/Sphere.obj");
  12. model.SetPosition(0.0f, 0.0f, -5.0f);
  13. }
  14. void SetViewPortSize(float width, float height) {
  15. projectionMatrix = glm::perspective(60.0f, width / height, 0.1f, 1000.0f);
  16. }
  17. void Draw() {
  18. float frameTime = GetFrameTime();
  19. glClearColor(0.1f, 0.4f, 0.6f, 1.0f);
  20. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  21. ground.Draw(viewMatrix, projectionMatrix);
  22. model.Draw(viewMatrix, projectionMatrix);
  23. }