change names from fish to submarine

This commit is contained in:
Thyme1 2021-12-29 21:47:09 +01:00
parent cad4a437de
commit 29872be109

View File

@ -16,7 +16,7 @@
GLuint skyboxProgram, skyboxBuffer;
GLuint programColor;
GLuint programTexture;
GLuint textureFish;
GLuint textureSubmarine;
unsigned int cubemapTexture, skyboxVAO;
float old_x, old_y = -1;
@ -32,7 +32,7 @@ glm::quat rotation = glm::quat(1, 0, 0, 0);
glm::mat4 cameraMatrix, perspectiveMatrix;
Core::Shader_Loader shaderLoader;
Core::RenderContext fishContext;
Core::RenderContext submarineContext;
std::string skyboxTextures[6] = {
"models/skybox/right.jpg",
@ -214,10 +214,10 @@ void renderScene()
glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(0);
glm::mat4 fishInitialTransformation = glm::translate(glm::vec3(-1, 0, -0.5)) * glm::rotate(glm::radians(180.0f), glm::vec3(0, 1, 0)) * glm::scale(glm::vec3(0.25f));
glm::mat4 fishModelMatrix = glm::translate(cameraPos + cameraDir) * glm::mat4_cast(glm::inverse(rotation)) * fishInitialTransformation;
glm::mat4 submarineInitialTransformation = glm::translate(glm::vec3(-1, 0, -0.5)) * glm::rotate(glm::radians(180.0f), glm::vec3(0, 1, 0)) * glm::scale(glm::vec3(0.25f));
glm::mat4 submarineModelMatrix = glm::translate(cameraPos + cameraDir) * glm::mat4_cast(glm::inverse(rotation)) * submarineInitialTransformation;
//drawObjectColor(fishContext, fishModelMatrix, glm::vec3(0.6f));
drawObjectTexture(fishContext, fishModelMatrix, textureFish);
drawObjectTexture(submarineContext, submarineModelMatrix, textureSubmarine);
glutSwapBuffers();
}
@ -291,8 +291,8 @@ void init()
programTexture = shaderLoader.CreateProgram((char*) "shaders/shader_tex.vert", (char*) "shaders/shader_tex.frag");
skyboxProgram = shaderLoader.CreateProgram((char *) "shaders/skybox.vert", (char *) "shaders/skybox.frag");
cubemapTexture = loadCubemap();
loadModelToContext("models/submarine.obj", fishContext);
textureFish = Core::LoadTexture("textures/submarine.png");
loadModelToContext("models/submarine.obj", submarineContext);
textureSubmarine = Core::LoadTexture("textures/submarine.png");
initSkybox();
}