diff --git a/Debug/grk-cw9.exe b/Debug/grk-cw9.exe index b24ad3a..0844d2c 100644 Binary files a/Debug/grk-cw9.exe and b/Debug/grk-cw9.exe differ diff --git a/Debug/grk-cw9.pdb b/Debug/grk-cw9.pdb index 8edd3ed..7dbb16a 100644 Binary files a/Debug/grk-cw9.pdb and b/Debug/grk-cw9.pdb differ diff --git a/cw 9/Debug/Box.obj b/cw 9/Debug/Box.obj index 958dd04..4339345 100644 Binary files a/cw 9/Debug/Box.obj and b/cw 9/Debug/Box.obj differ diff --git a/cw 9/Debug/Camera.obj b/cw 9/Debug/Camera.obj index 6355ccd..32b1476 100644 Binary files a/cw 9/Debug/Camera.obj and b/cw 9/Debug/Camera.obj differ diff --git a/cw 9/Debug/Render_Utils.obj b/cw 9/Debug/Render_Utils.obj index 007b330..3b97c1a 100644 Binary files a/cw 9/Debug/Render_Utils.obj and b/cw 9/Debug/Render_Utils.obj differ diff --git a/cw 9/Debug/SOIL.obj b/cw 9/Debug/SOIL.obj index 5794f72..6a8425c 100644 Binary files a/cw 9/Debug/SOIL.obj and b/cw 9/Debug/SOIL.obj differ diff --git a/cw 9/Debug/Shader_Loader.obj b/cw 9/Debug/Shader_Loader.obj index 4f94ceb..a110311 100644 Binary files a/cw 9/Debug/Shader_Loader.obj and b/cw 9/Debug/Shader_Loader.obj differ diff --git a/cw 9/Debug/Texture.obj b/cw 9/Debug/Texture.obj index bdabb1a..ad6d3ef 100644 Binary files a/cw 9/Debug/Texture.obj and b/cw 9/Debug/Texture.obj differ diff --git a/cw 9/Debug/grk-cw9.exe.recipe b/cw 9/Debug/grk-cw9.exe.recipe index 94418ec..74c2664 100644 --- a/cw 9/Debug/grk-cw9.exe.recipe +++ b/cw 9/Debug/grk-cw9.exe.recipe @@ -2,7 +2,7 @@ - C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\Debug\grk-cw9.exe + C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\Debug\grk-cw9.exe diff --git a/cw 9/Debug/grk-cw9.log b/cw 9/Debug/grk-cw9.log index 9c4ffdc..6e50456 100644 --- a/cw 9/Debug/grk-cw9.log +++ b/cw 9/Debug/grk-cw9.log @@ -1 +1,65 @@ - grk-cw9.vcxproj -> C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\Debug\grk-cw9.exe + main.cpp +C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(242,30): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(259,17): warning C4101: 'data': unreferenced local variable +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(284,38): warning C4305: '=': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(313,16): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(507,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(523,98): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(526,68): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(587,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(588,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(589,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(592,31): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(593,25): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(648,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(649,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(650,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(653,31): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(654,25): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(730,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(738,108): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(746,87): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(746,223): warning C4305: 'argument': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(749,59): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(750,37): warning C4305: 'argument': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(782,2): warning C4305: 'argument': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(875,108): warning C4305: 'argument': truncation from 'double' to 'T' + with + [ + T=float + ] +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(1112,21): warning C4305: '-=': truncation from 'double' to 'float' +C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\cw 9\src\ex_9_1.hpp(1114,21): warning C4305: '+=': truncation from 'double' to 'float' +Box.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification +LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library + grk-cw9.vcxproj -> C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\Debug\grk-cw9.exe diff --git a/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog index 0799c48..b36515d 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.command.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog index 97ed39f..7e6465b 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.read.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog b/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog index f6bed05..2ac8ac7 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog and b/cw 9/Debug/grk-cw9.tlog/CL.write.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate b/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate index edd43f6..7532145 100644 --- a/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate +++ b/cw 9/Debug/grk-cw9.tlog/grk-cw9.lastbuildstate @@ -1,2 +1,2 @@ -PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0: -Debug|Win32|C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\| +PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.30.30705:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\Users\walcz\Desktop\nowe\GRK_Project\GRK_Project\| diff --git a/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog index d005f57..d96ec4e 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.command.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog index c194e0c..ca2d226 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.read.1.tlog differ diff --git a/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog b/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog index 4ff5fa9..369ee51 100644 Binary files a/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog and b/cw 9/Debug/grk-cw9.tlog/link.write.1.tlog differ diff --git a/cw 9/Debug/image_DXT.obj b/cw 9/Debug/image_DXT.obj index a69fdd8..d1c4f61 100644 Binary files a/cw 9/Debug/image_DXT.obj and b/cw 9/Debug/image_DXT.obj differ diff --git a/cw 9/Debug/image_helper.obj b/cw 9/Debug/image_helper.obj index 6f5539d..42cfa2f 100644 Binary files a/cw 9/Debug/image_helper.obj and b/cw 9/Debug/image_helper.obj differ diff --git a/cw 9/Debug/main.obj b/cw 9/Debug/main.obj index 642a4df..514d869 100644 Binary files a/cw 9/Debug/main.obj and b/cw 9/Debug/main.obj differ diff --git a/cw 9/Debug/stb_image_aug.obj b/cw 9/Debug/stb_image_aug.obj index f94d86f..fd04a2e 100644 Binary files a/cw 9/Debug/stb_image_aug.obj and b/cw 9/Debug/stb_image_aug.obj differ diff --git a/cw 9/shaders/bubbles_shader_color.frag b/cw 9/shaders/bubbles_shader_color.frag new file mode 100644 index 0000000..c791d67 --- /dev/null +++ b/cw 9/shaders/bubbles_shader_color.frag @@ -0,0 +1,13 @@ +#version 410 core + +uniform vec3 objectColor; +uniform vec3 lightDir; + +in vec3 interpNormal; + +void main() +{ + vec3 normal = normalize(interpNormal); + float diffuse = 0.4; + gl_FragColor = vec4(objectColor * diffuse, 1.0); +} diff --git a/cw 9/shaders/bubbles_shader_color.vert b/cw 9/shaders/bubbles_shader_color.vert new file mode 100644 index 0000000..ac46ad3 --- /dev/null +++ b/cw 9/shaders/bubbles_shader_color.vert @@ -0,0 +1,16 @@ +#version 410 core + +layout(location = 0) in vec3 vertexPosition; +layout(location = 1) in vec3 vertexNormal; +layout(location = 2) in vec2 vertexTexCoord; + +uniform mat4 modelViewProjectionMatrix; +uniform mat4 modelMatrix; + +out vec3 interpNormal; + +void main() +{ + gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0); + interpNormal = (modelMatrix * vec4(vertexNormal, 0.0)).xyz; +} \ No newline at end of file diff --git a/cw 9/src/ex_9_1.hpp b/cw 9/src/ex_9_1.hpp index 9207f3f..ca5d491 100644 --- a/cw 9/src/ex_9_1.hpp +++ b/cw 9/src/ex_9_1.hpp @@ -193,14 +193,26 @@ GLuint programDepth; GLuint programSkybox; GLuint programWater; GLuint skyboxTexture; +GLuint bubblesColor; +GLuint bubbleTexture; +Core::RenderContext bubbleContext; Core::Shader_Loader shaderLoader; Core::RenderContext waterContext; Core::RenderContext shipContext; Core::RenderContext sphereContext; TriangleSoup water; +CONST int bubbleQuantity = 2000; +glm::vec3 bubbleLocation[bubbleQuantity]; +glm::vec3 bubbleOriginalLocation[bubbleQuantity]; +bool bubbleZdir[bubbleQuantity]; +bool bubbleXdir[bubbleQuantity]; + + + + glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, 0.369280f); glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f); glm::vec3 sunColor = glm::vec3(0.9f, 0.9f, 0.7f) * 5; @@ -230,6 +242,8 @@ glm::vec3 lightPos = glm::vec3(-8, 4, 2); float lastTime = -1.f; float deltaTime = 0.f; +void bubbleManager(); + unsigned int loadSkybox(std::vector faces) { unsigned int textureID; @@ -465,6 +479,23 @@ void drawObjectDepth(Core::RenderContext context, glm::mat4 viewProjectionMatrix glUniformMatrix4fv(glGetUniformLocation(programDepth, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix); Core::DrawContext(context); } +void drawBubbleColor(Core::RenderContext context, glm::mat4 modelMatrix, glm::vec3 color) +{ + GLuint program = bubblesColor; + + glUseProgram(program); + + glUniform3f(glGetUniformLocation(program, "objectColor"), color.x, color.y, color.z); + glUniform3f(glGetUniformLocation(program, "lightDir"), sunDir.x, sunDir.y, sunDir.z); + + glm::mat4 transformation = createPerspectiveMatrix() * createCameraMatrix() * modelMatrix; + glUniformMatrix4fv(glGetUniformLocation(program, "modelViewProjectionMatrix"), 1, GL_FALSE, (float*)&transformation); + glUniformMatrix4fv(glGetUniformLocation(program, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix); + + Core::DrawContext(context); + + glUseProgram(0); +} void renderShadowapSun() { @@ -504,7 +535,6 @@ void renderShadowapSun() { - glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, WIDTH, HEIGHT); } @@ -545,6 +575,97 @@ void drawObjectColorWater(Core::RenderContext& context, glm::mat4 modelMatrix, g water.render(); } +void bubbleMovement(int i) { + + float bubbleWobblingDivider = 100; + + int x = floor(bubbleLocation[i].x); + int y = floor(bubbleLocation[i].y); + int z = floor(bubbleLocation[i].z); + + + float bubbleWobbling = 0.0005; + float bubbleDown = 0.05; + + //printf(xDir ? "true\n" : "false\n"); + //printf(zDir ? "true\n" : "false\n"); + + if (bubbleLocation[i].x >= bubbleOriginalLocation[i].x + bubbleWobbling * bubbleWobblingDivider) { + + bubbleXdir[i] = false; + //printf("herex1\n"); + } + else if (bubbleLocation[i].x < bubbleOriginalLocation[i].x - bubbleWobbling * bubbleWobblingDivider) { + bubbleXdir[i] = true; + //printf("herex2\n"); + } + + if (bubbleLocation[i].z >= bubbleOriginalLocation[i].z + bubbleWobbling * bubbleWobblingDivider) { + bubbleZdir[i] = false; + } + else if (bubbleLocation[i].z < bubbleOriginalLocation[i].z - bubbleWobbling * bubbleWobblingDivider) { + bubbleZdir[i] = true; + } + bubbleZdir[i] = false; + bubbleXdir[i] = false; + + + + if (bubbleXdir[i]) { + bubbleLocation[i].x += bubbleWobbling; + } + else { + bubbleLocation[i].x -= bubbleWobbling; + } + + if (bubbleZdir[i]) { + bubbleLocation[i].z += bubbleWobbling; + } + else { + bubbleLocation[i].z -= bubbleWobbling; + } + + if (y <= -10.0 ) { + bubbleLocation[i].y = 10.0; + } + if (x <= (-1.0 + 2.9) && x > (-1.0 - 2.9) && z <= (-1.2 + 3.2) && z > (-1.2 - 3.2) && y <= (1.0 + 2.36) ) { + bubbleLocation[i].y = 10.0; + } + + bubbleLocation[i].y -= bubbleDown; + + +} + + +void bubbleManager() { + + + for (int i = 0; i < bubbleQuantity; i++) + { + bubbleMovement(i); + + glm::mat4 modelMatrix = glm::translate(bubbleLocation[i]); + // Scaling models + glm::vec3 scale = glm::vec3(0.01, 0.04, 0.02); + modelMatrix = glm::scale(modelMatrix, scale); + //glUseProgram(programTex); + drawObjectTex(bubbleContext, modelMatrix, 0, 0, texture::water); + //drawBubbleColor(bubbleContext, modelMatrix, glm::vec3(.3f, .55f, 0.96f)); + // srand(time(NULL)); + float MAX_NUM = 20.0; + + //bubbleLocation[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + bubbleLocation[i].y = (((float)rand() / (float)(RAND_MAX)) * 10) - 5; + //bubbleLocation[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + + bubbleOriginalLocation[i] = bubbleLocation[i]; + + bubbleZdir[i] = true; + bubbleXdir[i] = false; + } +} + void renderScene(GLFWwindow* window) { @@ -646,19 +767,6 @@ void renderScene(GLFWwindow* window) drawObjectTexPBR_ARM(models::c_tableContext, glm::mat4(), texture::c_table_albedo, texture::c_table_normal, texture::c_table_arm); drawObjectTexPBR_ARM(models::vaseContext, glm::mat4(), texture::vase_albedo, texture::vase_normal, texture::vase_arm); - - - - - - - - - - - - - glUseProgram(programWater); //drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0, -1.0, 0.0)) * glm::scale(glm::vec3(30.0)), glm::vec3(0.1, 0.1, 0.95), time, texture::water); drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0f, -1.7f, 0.0f)), glm::vec4(0.1, 0.1, 0.95, 0.5), time, texture::water); @@ -671,7 +779,8 @@ void renderScene(GLFWwindow* window) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, depthMap); Core::DrawContext(models::testContext);*/ - + + bubbleManager(); glUseProgram(0); glfwSwapBuffers(window); } @@ -720,6 +829,7 @@ void init(GLFWwindow* window) programTex = shaderLoader.CreateProgram("shaders/shader_tex.vert", "shaders/shader_tex.frag"); programTexPBR = shaderLoader.CreateProgram("shaders/shader_tex_pbr.vert", "shaders/shader_tex_pbr.frag"); programTexPBR_ARM = shaderLoader.CreateProgram("shaders/shader_tex_pbr_arm.vert", "shaders/shader_tex_pbr_arm.frag"); + bubblesColor = shaderLoader.CreateProgram("shaders/bubbles_shader_color.vert", "shaders/bubbles_shader_color.frag"); water.readOBJ("./models/plane2.obj"); texture::water = Core::LoadTexture("textures/test.png"); texture::rust = Core::LoadTexture("textures/rust.jpg"); @@ -821,7 +931,7 @@ void init(GLFWwindow* window) texture::vase_normal = Core::LoadTexture("textures/vase/normal.png"); - + loadModelToContext("models/bubble.obj", bubbleContext, false); loadModelToContext("./models/sphere.obj", sphereContext, false); loadModelToContext("./models/spaceship.obj", shipContext, false); //loadModelToContext("./models/bed.obj", models::bedContext, true); @@ -866,7 +976,7 @@ void init(GLFWwindow* window) loadModelToContext("./models/uploads_files_1938755_KAUSTBY.obj", models::chairContext, false); loadModelToContext("./models/ceramic_vase_01.obj", models::vaseContext, true); //collisionSystem.calculateSceneBounding(); - + skyboxTexture = loadSkybox(faces); //drawSkybox(models::cubeContext, transformation, skyboxTexture); /*glUseProgram(programSkybox); @@ -914,6 +1024,22 @@ void processInput(GLFWwindow* window) texture::screen = Core::LoadTexture("textures/visual.png"); PlaySound(nullptr, nullptr, 0); } + if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) { + for (int i = 0; i < bubbleQuantity; i++) + { + // srand(time(NULL)); + float MAX_NUM = 20.0; + + bubbleLocation[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + bubbleLocation[i].y = (((float)rand() / (float)(RAND_MAX)) * 10) - 5; + bubbleLocation[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2; + + bubbleOriginalLocation[i] = bubbleLocation[i]; + + bubbleZdir[i] = true; + bubbleXdir[i] = false; + } + } cameraDir = spaceshipDir; cameraPos = newSpaceshipPos - 0.5 * spaceshipDir + glm::vec3(0, 1, 0) * 0.2f;