add texture on xThing object

This commit is contained in:
Danila 2023-02-07 22:35:24 +01:00
parent c0ed1e080e
commit 57eb90ad36
2 changed files with 10 additions and 5 deletions

View File

@ -34,6 +34,7 @@ namespace texture {
GLuint wall4; GLuint wall4;
GLuint ship; GLuint ship;
GLuint roof; GLuint roof;
GLuint xThing;
} }
namespace models { namespace models {
@ -612,28 +613,30 @@ void renderScene(GLFWwindow* window)
drawObjectPBR(models::vase1Context, glm::mat4(), glm::vec3(0.320f, 0.11f, 0.131f), 0.2f, 0.0f); drawObjectPBR(models::vase1Context, glm::mat4(), glm::vec3(0.320f, 0.11f, 0.131f), 0.2f, 0.0f);
drawObjectPBR(models::vase2Context, glm::mat4(), glm::vec3(0.4f, 0.2f, 0.1f), 0.2f, 0.0f); drawObjectPBR(models::vase2Context, glm::mat4(), glm::vec3(0.4f, 0.2f, 0.1f), 0.2f, 0.0f);
//drawObjectPBR(models::sofaContext, glm::mat4(), glm::vec3(0.620f, 0.313f, 0.131f), 0.2f, 0.0f);
drawObjectPBR(models::tvTableContext, glm::mat4(), glm::vec3(0.4f, 0.4f, 0.4f), 0.4f, 0.0f); drawObjectPBR(models::tvTableContext, glm::mat4(), glm::vec3(0.4f, 0.4f, 0.4f), 0.4f, 0.0f);
drawObjectPBR(models::tableContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f); drawObjectPBR(models::tableContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f);
drawObjectPBR(models::doorContext, glm::mat4()/*glm::rotate(glm::mat4(), time * glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f))*/, glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); drawObjectPBR(models::doorContext, glm::mat4()/*glm::rotate(glm::mat4(), time * glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f))*/, glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
drawObjectPBR(models::doorFrameContext, glm::mat4(), glm::vec3(0.45f, 0.120f, 0.057f), 0.26f, 0.0f); drawObjectPBR(models::doorFrameContext, glm::mat4(), glm::vec3(0.45f, 0.120f, 0.057f), 0.26f, 0.0f);
drawObjectPBR(models::drawerContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f); drawObjectPBR(models::drawerContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f);
drawObjectPBR(models::tvContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f); drawObjectPBR(models::tvContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f);
drawObjectPBR(models::xThingContext, glm::mat4(), glm::vec3(0.10039f, 0.018356f, 0.001935f), 0.1f, 0.0f); drawObjectPBR(models::windowContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
//drawObjectPBR(models::sofaContext, glm::mat4(), glm::vec3(0.620f, 0.313f, 0.131f), 0.2f, 0.0f);
//drawObjectPBR(models::xThingContext, glm::mat4(), glm::vec3(0.10039f, 0.018356f, 0.001935f), 0.1f, 0.0f);
//drawObjectPBR(models::planeContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); //drawObjectPBR(models::planeContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
//drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f); //drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f);
drawObjectPBR(models::windowContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
//drawObjectPBR(models::roofContext, glm::mat4(), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.0f); //drawObjectPBR(models::roofContext, glm::mat4(), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.0f);
drawObjectTexture(models::planeContext, glm::mat4(), texture::floor); drawObjectTexture(models::planeContext, glm::mat4(), texture::floor);
drawObjectTexture(models::xThingContext, glm::mat4(), texture::xThing);
drawObjectTexture(models::sofaContext, glm::mat4(), texture::sofa); drawObjectTexture(models::sofaContext, glm::mat4(), texture::sofa);
drawObjectTexture(models::roofContext, glm::mat4(), texture::roof);
drawObjectTexture(models::roomContext, glm::mat4(), texture::wall1);
//drawObjectTexture(models::wall1Context, glm::mat4(), texture::wall1); //drawObjectTexture(models::wall1Context, glm::mat4(), texture::wall1);
//drawObjectTexture(models::wall2Context, glm::mat4(), texture::wall2); //drawObjectTexture(models::wall2Context, glm::mat4(), texture::wall2);
//drawObjectTexture(models::wall3Context, glm::mat4(), texture::wall3); //drawObjectTexture(models::wall3Context, glm::mat4(), texture::wall3);
//drawObjectTexture(models::wall4Context, glm::mat4(), texture::wall4); //drawObjectTexture(models::wall4Context, glm::mat4(), texture::wall4);
drawObjectTexture(models::roofContext, glm::mat4(), texture::roof);
drawObjectTexture(models::roomContext, glm::mat4(), texture::wall1);
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceShip.getSpaceShipDir(), glm::vec3(0.f, 1.f, 0.f))); glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceShip.getSpaceShipDir(), glm::vec3(0.f, 1.f, 0.f)));
@ -869,6 +872,8 @@ void init(GLFWwindow* window)
loadModelToContext("./models/test.obj", models::testContext); loadModelToContext("./models/test.obj", models::testContext);
texture::sofa = Core::LoadTexture("textures/sofa.jpg"); texture::sofa = Core::LoadTexture("textures/sofa.jpg");
texture::xThing = Core::LoadTexture("textures/xThing.png");
texture::floor = Core::LoadTexture("textures/floor.jpg"); texture::floor = Core::LoadTexture("textures/floor.jpg");
texture::wall1 = Core::LoadTexture("textures/wall.jpg"); texture::wall1 = Core::LoadTexture("textures/wall.jpg");
texture::wall2 = Core::LoadTexture("textures/wall.jpg"); texture::wall2 = Core::LoadTexture("textures/wall.jpg");

BIN
cw 9/textures/xThing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB