From 15bcb698bd8fe9920e73cfc6bafc571c51a5f509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A4=E9=BE=99?= <68932014+12gch138@users.noreply.github.com> Date: Sun, 18 Dec 2022 11:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E7=9A=84=E5=A4=A9?= =?UTF-8?q?=E7=A9=BA=E7=9B=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FinalProject/sceneviewer.cpp | 2 +- FinalProject/skybox.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/FinalProject/sceneviewer.cpp b/FinalProject/sceneviewer.cpp index 7ce9981..1c74c12 100644 --- a/FinalProject/sceneviewer.cpp +++ b/FinalProject/sceneviewer.cpp @@ -110,7 +110,7 @@ void SceneViewer::paintGL() { glm::mat4 view = _camera.viewMatrix(); glm::mat4 projection = glm::perspective(glm::radians(_camera.zoomVal()), (float)width() / (float)height(), 0.1f, 100.0f); Model = glm::translate(Model, glm::vec3(0.0f, -5.0f, 0.0f)); - Model = glm::scale(Model, glm::vec3(10.0f)); + Model = glm::scale(Model, glm::vec3(100.0f)); terrainShader.setUniform("view", view); terrainShader.setUniform("projection", projection); terrainShader.setUniform("model", Model); diff --git a/FinalProject/skybox.cpp b/FinalProject/skybox.cpp index ba2b009..32a3dfd 100644 --- a/FinalProject/skybox.cpp +++ b/FinalProject/skybox.cpp @@ -11,8 +11,8 @@ skybox::skybox(std::string path){ faces.clear(); faces.push_back(path + "/right.jpg"); faces.push_back(path + "/left.jpg"); - faces.push_back(path + "/bottom.jpg"); faces.push_back(path + "/top.jpg"); + faces.push_back(path + "/bottom.jpg"); faces.push_back(path + "/front.jpg"); faces.push_back(path + "/back.jpg"); @@ -43,7 +43,8 @@ unsigned int skybox::loadCubemap(std::vector faces) unsigned int textureID; OPENGL_FUNCTIONS->glGenTextures(1, &textureID); OPENGL_FUNCTIONS->glBindTexture(GL_TEXTURE_CUBE_MAP, textureID); - stbi_set_flip_vertically_on_load(true); + + stbi_set_flip_vertically_on_load(false); int width, height, nrChannels; for (unsigned int i = 0; i < faces.size(); i++)