diff --git a/Release/grk-cw9.exe b/Release/grk-cw9.exe
index 2f89c2e..4cf0a24 100644
Binary files a/Release/grk-cw9.exe and b/Release/grk-cw9.exe differ
diff --git a/Release/grk-cw9.pdb b/Release/grk-cw9.pdb
index cd714de..2a2453a 100644
Binary files a/Release/grk-cw9.pdb and b/Release/grk-cw9.pdb differ
diff --git a/cw 9/Release/Box.obj b/cw 9/Release/Box.obj
index 4fcca86..79b461e 100644
Binary files a/cw 9/Release/Box.obj and b/cw 9/Release/Box.obj differ
diff --git a/cw 9/Release/Camera.obj b/cw 9/Release/Camera.obj
index 308cd37..7793d68 100644
Binary files a/cw 9/Release/Camera.obj and b/cw 9/Release/Camera.obj differ
diff --git a/cw 9/Release/Render_Utils.obj b/cw 9/Release/Render_Utils.obj
index 75737f1..7b646c2 100644
Binary files a/cw 9/Release/Render_Utils.obj and b/cw 9/Release/Render_Utils.obj differ
diff --git a/cw 9/Release/SOIL.obj b/cw 9/Release/SOIL.obj
index 87faa6f..3feca7b 100644
Binary files a/cw 9/Release/SOIL.obj and b/cw 9/Release/SOIL.obj differ
diff --git a/cw 9/Release/Shader_Loader.obj b/cw 9/Release/Shader_Loader.obj
index 2bc2c56..a753536 100644
Binary files a/cw 9/Release/Shader_Loader.obj and b/cw 9/Release/Shader_Loader.obj differ
diff --git a/cw 9/Release/Texture.obj b/cw 9/Release/Texture.obj
index 74dd8d4..b970ded 100644
Binary files a/cw 9/Release/Texture.obj and b/cw 9/Release/Texture.obj differ
diff --git a/cw 9/Release/TriangleSoup.obj b/cw 9/Release/TriangleSoup.obj
index a8ec373..73797e2 100644
Binary files a/cw 9/Release/TriangleSoup.obj and b/cw 9/Release/TriangleSoup.obj differ
diff --git a/cw 9/Release/grk-cw9.exe.recipe b/cw 9/Release/grk-cw9.exe.recipe
index bd4b977..26bd0b6 100644
--- a/cw 9/Release/grk-cw9.exe.recipe
+++ b/cw 9/Release/grk-cw9.exe.recipe
@@ -2,7 +2,7 @@
- C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe
+ C:\Users\jedrz\Desktop\g\GRK_Project\Release\grk-cw9.exe
diff --git a/cw 9/Release/grk-cw9.iobj b/cw 9/Release/grk-cw9.iobj
index 749c99f..c0a0aee 100644
Binary files a/cw 9/Release/grk-cw9.iobj and b/cw 9/Release/grk-cw9.iobj differ
diff --git a/cw 9/Release/grk-cw9.ipdb b/cw 9/Release/grk-cw9.ipdb
index 7ab8499..9a03267 100644
Binary files a/cw 9/Release/grk-cw9.ipdb and b/cw 9/Release/grk-cw9.ipdb differ
diff --git a/cw 9/Release/grk-cw9.log b/cw 9/Release/grk-cw9.log
index 57910a9..36dd9d3 100644
--- a/cw 9/Release/grk-cw9.log
+++ b/cw 9/Release/grk-cw9.log
@@ -1,69 +1,83 @@
main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
-C:\Users\jedrz\Desktop\graf\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(270,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(284,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(309,38): warning C4305: "=": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(338,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(527,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(541,98): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(302,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(319,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(344,38): warning C4305: "=": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(373,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(578,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(586,73): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(586,66): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(601,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(619,98): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(544,68): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(622,68): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(576,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(590,99): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(657,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(671,99): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(593,69): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(674,69): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(685,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(694,108): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(770,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(771,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(772,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(775,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(776,25): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(832,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(833,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(834,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(837,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(838,25): warning C4305: "inicjowanie": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(944,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(957,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,87): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(966,87): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,223): warning C4305: "argument": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(705,59): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(966,223): warning C4305: "argument": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(967,86): warning C4305: "argument": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(968,96): warning C4305: "argument": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(988,2): warning C4305: "argument": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1088,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(706,37): warning C4305: "argument": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(726,2): warning C4305: "argument": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(825,108): warning C4305: "argument": obcięcie z "double" do "T"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1371,66): warning C4244: "=": konwersja z "double" do "T", możliwa utrata danych
with
[
T=float
]
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1088,21): warning C4305: "-=": obcięcie z "double" do "float"
-C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1090,21): warning C4305: "+=": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1388,21): warning C4305: "-=": obcięcie z "double" do "float"
+C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1390,21): warning C4305: "+=": obcięcie z "double" do "float"
Trwa generowanie kodu
- 2 of 687 functions ( 0.3%) were compiled, the rest were copied from previous compilation.
+ 2 of 705 functions ( 0.3%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
- 10 functions had inline decision re-evaluated but remain unchanged
+ 8 functions had inline decision re-evaluated but remain unchanged
Zakończono generowanie kodu
- grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe
+ grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\g\GRK_Project\Release\grk-cw9.exe
diff --git a/cw 9/Release/grk-cw9.tlog/CL.command.1.tlog b/cw 9/Release/grk-cw9.tlog/CL.command.1.tlog
index c23d77e..464dc65 100644
Binary files a/cw 9/Release/grk-cw9.tlog/CL.command.1.tlog and b/cw 9/Release/grk-cw9.tlog/CL.command.1.tlog differ
diff --git a/cw 9/Release/grk-cw9.tlog/CL.read.1.tlog b/cw 9/Release/grk-cw9.tlog/CL.read.1.tlog
index 197dcd5..0f17c32 100644
Binary files a/cw 9/Release/grk-cw9.tlog/CL.read.1.tlog and b/cw 9/Release/grk-cw9.tlog/CL.read.1.tlog differ
diff --git a/cw 9/Release/grk-cw9.tlog/CL.write.1.tlog b/cw 9/Release/grk-cw9.tlog/CL.write.1.tlog
index f1ef338..566658b 100644
Binary files a/cw 9/Release/grk-cw9.tlog/CL.write.1.tlog and b/cw 9/Release/grk-cw9.tlog/CL.write.1.tlog differ
diff --git a/cw 9/Release/grk-cw9.tlog/grk-cw9.lastbuildstate b/cw 9/Release/grk-cw9.tlog/grk-cw9.lastbuildstate
index 2a86d8e..5f14e29 100644
--- a/cw 9/Release/grk-cw9.tlog/grk-cw9.lastbuildstate
+++ b/cw 9/Release/grk-cw9.tlog/grk-cw9.lastbuildstate
@@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
-Release|Win32|C:\Users\jedrz\Desktop\graf\GRK_Project\|
+Release|Win32|C:\Users\jedrz\Desktop\g\GRK_Project\|
diff --git a/cw 9/Release/grk-cw9.tlog/link.command.1.tlog b/cw 9/Release/grk-cw9.tlog/link.command.1.tlog
index 822e4cb..0f42571 100644
Binary files a/cw 9/Release/grk-cw9.tlog/link.command.1.tlog and b/cw 9/Release/grk-cw9.tlog/link.command.1.tlog differ
diff --git a/cw 9/Release/grk-cw9.tlog/link.read.1.tlog b/cw 9/Release/grk-cw9.tlog/link.read.1.tlog
index 1e885c7..8ef3e4a 100644
Binary files a/cw 9/Release/grk-cw9.tlog/link.read.1.tlog and b/cw 9/Release/grk-cw9.tlog/link.read.1.tlog differ
diff --git a/cw 9/Release/grk-cw9.tlog/link.write.1.tlog b/cw 9/Release/grk-cw9.tlog/link.write.1.tlog
index 600606f..451d3e1 100644
Binary files a/cw 9/Release/grk-cw9.tlog/link.write.1.tlog and b/cw 9/Release/grk-cw9.tlog/link.write.1.tlog differ
diff --git a/cw 9/Release/image_DXT.obj b/cw 9/Release/image_DXT.obj
index ce9026c..023bf31 100644
Binary files a/cw 9/Release/image_DXT.obj and b/cw 9/Release/image_DXT.obj differ
diff --git a/cw 9/Release/image_helper.obj b/cw 9/Release/image_helper.obj
index af5f580..1a3f768 100644
Binary files a/cw 9/Release/image_helper.obj and b/cw 9/Release/image_helper.obj differ
diff --git a/cw 9/Release/main.obj b/cw 9/Release/main.obj
index 964b711..dea5e7e 100644
Binary files a/cw 9/Release/main.obj and b/cw 9/Release/main.obj differ
diff --git a/cw 9/Release/stb_image_aug.obj b/cw 9/Release/stb_image_aug.obj
index 4f7ae0e..a5cf614 100644
Binary files a/cw 9/Release/stb_image_aug.obj and b/cw 9/Release/stb_image_aug.obj differ
diff --git a/cw 9/grk-cw9.vcxproj.filters b/cw 9/grk-cw9.vcxproj.filters
index 6fc9fb8..07ea9dd 100644
--- a/cw 9/grk-cw9.vcxproj.filters
+++ b/cw 9/grk-cw9.vcxproj.filters
@@ -154,7 +154,11 @@
Shader Files
-
-
+
+ Shader Files
+
+
+ Shader Files
+
\ 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 cb945d6..daee783 100644
--- a/cw 9/src/ex_9_1.hpp
+++ b/cw 9/src/ex_9_1.hpp
@@ -78,6 +78,8 @@ namespace models {
Core::RenderContext books1Context;
Core::RenderContext books2Context;
Core::RenderContext cactusContext;
+ Core::RenderContext fanContext;
+ Core::RenderContext fanTopContext;
}
std::vector faces = {
@@ -224,6 +226,7 @@ namespace texture {
GLuint cactus_ao;
GLuint cactus_normal;
+ GLuint metal;
}
GLuint depthMapFBO;
@@ -231,6 +234,8 @@ GLuint depthMap;
GLuint depthMapFBO2;
GLuint depthMap2;
+int speed = 300;
+
GLuint program;
GLuint programSun;
GLuint programTest;
@@ -267,7 +272,7 @@ glm::vec3 bubbleOriginalLocationInRoom[bubblenumber];
bool bubbleZdirInRoom[bubblenumber];
bool bubbleXdirInRoom[bubblenumber];
-glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, 0.369280f);
+glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, -0.069280f);
glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f);
glm::vec3 sunPos2 = glm::vec3(4.040971f, 2.149999f, -0.739280f);
glm::vec3 sunDir2 = glm::vec3(0.93633f, 0.351106, -0.003226f);
@@ -592,7 +597,7 @@ void drawBubble(glm::mat4 transformSphere) {
}
-void renderShadowapSun() {
+void renderShadowapSun(float angle) {
float time = glfwGetTime();
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//uzupelnij o renderowanie glebokosci do tekstury
@@ -607,6 +612,10 @@ void renderShadowapSun() {
//ustawianie programu
glUseProgram(programDepth);
+ glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
+ glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
+ glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
+
drawObjectDepth(sphereContext, lightVP, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
drawObjectDepth(sphereContext,
@@ -637,6 +646,9 @@ void renderShadowapSun() {
drawObjectDepth(models::books1Context, lightVP, glm::mat4());
drawObjectDepth(models::books2Context, lightVP, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP, glm::mat4());
+ drawObjectDepth(models::fanContext, lightVP,glm::mat4());
+ drawObjectDepth(models::fanTopContext, lightVP, glm::mat4()*rotate);
+ drawObjectDepth(models::tableContext, lightVP, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
@@ -686,6 +698,10 @@ void renderShadowapSun2() {
drawObjectDepth(models::books1Context, lightVP2, glm::mat4());
drawObjectDepth(models::books2Context, lightVP2, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP2, glm::mat4());
+ drawObjectDepth(models::fanContext, lightVP2, glm::mat4());
+ drawObjectDepth(models::fanTopContext, lightVP2, glm::mat4());
+ drawObjectDepth(models::tableContext, lightVP2, glm::mat4());
+
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
@@ -927,8 +943,12 @@ void renderScene(GLFWwindow* window)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float time = glfwGetTime();
updateDeltaTime(time);
-
- renderShadowapSun();
+ float angle = 0;
+ angle += static_cast(glfwGetTime());
+ glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
+ glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
+ glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
+ renderShadowapSun(angle);
renderShadowapSun2();
//space lamp
@@ -941,9 +961,11 @@ void renderScene(GLFWwindow* window)
Core::DrawContext(sphereContext);
drawSkybox(models::cubeContext, createPerspectiveMatrix() * glm::mat4(glm::mat3(createCameraMatrix())), skyboxTexture);
glUseProgram(program);
-
+ glm::mat4 transform(1.0f);
+ //transform = glm::rotate(glm::mat4(), angle, glm::vec3(1.0f, 0.0f, 0.0f));
drawObjectPBR(sphereContext, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)), glm::vec3(0.2, 0.7, 0.3), 0.3, 0.0);
-
+ drawObjectPBR(models::fanContext, glm::mat4(), glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
+ drawObjectPBR(models::fanTopContext, glm::mat4()*rotate, glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 spaceshipUp = glm::normalize(glm::cross(spaceshipSide, spaceshipDir));
@@ -975,7 +997,7 @@ void renderScene(GLFWwindow* window)
drawObjectTex(models::screenContext, glm::mat4(), 0, 0, texture::screen);
glUseProgram(programTexPBR);
- //drawObjectTexPBR(models::deskContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
+ drawObjectTexPBR(models::tableContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
drawObjectTexPBR(models::bedContext, glm::mat4(), texture::wood_roughness, texture::wood_metallic, texture::wood_albedo, texture::wood_normal, texture::wood_ao);
drawObjectTexPBR(models::mattressContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
drawObjectTexPBR(models::bed_pillowContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
@@ -1083,11 +1105,11 @@ void init(GLFWwindow* window)
water.readOBJ("./models/plane2.obj");
texture::water = Core::LoadTexture("textures/test.png");
texture::rust = Core::LoadTexture("textures/rust.jpg");
- texture::table_albedo = Core::LoadTexture("textures/table_albedo.png");
- texture::table_metallic = Core::LoadTexture("textures/table_metallic.png");
- texture::table_roughness = Core::LoadTexture("textures/table_roughness.png");
- texture::table_ao = Core::LoadTexture("textures/table_ao.png");
- texture::table_normal = Core::LoadTexture("textures/table_normal.jpg");
+ texture::table_albedo = Core::LoadTexture("textures/table/albedo.png");
+ texture::table_metallic = Core::LoadTexture("textures/table/metallic.png");
+ texture::table_roughness = Core::LoadTexture("textures/table/roughness.png");
+ texture::table_ao = Core::LoadTexture("textures/table/ao.png");
+ texture::table_normal = Core::LoadTexture("textures/table/normal.png");
texture::wood_albedo = Core::LoadTexture("textures/wood_albedo.jpg");
texture::wood_metallic = Core::LoadTexture("textures/wood_metallic.jpg");
texture::wood_roughness = Core::LoadTexture("textures/wood_roughness.jpg");
@@ -1210,6 +1232,8 @@ void init(GLFWwindow* window)
texture::cactus_roughness = Core::LoadTexture("textures/cactus/roughness.png");
texture::cactus_ao = Core::LoadTexture("textures/cactus/ao.png");
texture::cactus_normal = Core::LoadTexture("textures/cactus/normal.png");
+
+ texture::metal = Core::LoadTexture("textures/metal.png");
loadModelToContext("models/bubble.obj", bubbleContext, false);
loadModelToContext("./models/sphere.obj", sphereContext, false);
loadModelToContext("./models/spaceship.obj", shipContext, false);
@@ -1228,7 +1252,7 @@ void init(GLFWwindow* window)
//loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/test.obj", models::testContext, false);
loadModelToContext("./models/cube.obj", models::cubeContext, false);
- //loadModelToContext("./models/table.obj", models::tableContext, false);
+ loadModelToContext("./models/tab.obj", models::tableContext, false);
loadModelToContext("./models/wall.obj", models::wallContext, false);
loadModelToContext("./models/roof.obj", models::roofContext, false);
loadModelToContext("./models/window.obj", models::windowContext, true);
@@ -1261,6 +1285,8 @@ void init(GLFWwindow* window)
loadModelToContext("./models/cactus.obj", models::cactusContext, false);
loadModelToContext("./models/books1.obj", models::books1Context, false);
loadModelToContext("./models/books2.obj", models::books2Context, false);
+ loadModelToContext("./models/fan.obj", models::fanContext, false);
+ loadModelToContext("./models/fan_top.obj", models::fanTopContext, false);
collisionSystem.calculateSceneBounding();
@@ -1322,7 +1348,7 @@ void processInput(GLFWwindow* window)
texture::screen = Core::LoadTexture("textures/visual.png");
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
}
- if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) {
+ if (glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS) {
for (int i = 0; i < bubbleQuantity; i++)
{
// srand(time(NULL));
@@ -1373,6 +1399,15 @@ void processInput(GLFWwindow* window)
float z = collisionSystem.getRelativeZ(spaceshipPos.z);
printf("matrix[%ff][%ff]\n", z, x);
}
+ if (glfwGetKey(window, GLFW_KEY_I) == GLFW_PRESS) {
+ speed = 0;
+ }
+ if (glfwGetKey(window, GLFW_KEY_O) == GLFW_PRESS) {
+ speed = 300;
+ }
+ if (glfwGetKey(window, GLFW_KEY_P) == GLFW_PRESS) {
+ speed = 600;
+ }
//cameraDir = glm::normalize(-cameraPos);
}
diff --git a/cw 9/textures/metal.png b/cw 9/textures/metal.png
new file mode 100644
index 0000000..6e5bb34
Binary files /dev/null and b/cw 9/textures/metal.png differ
diff --git a/cw 9/textures/table/albedo.png b/cw 9/textures/table/albedo.png
new file mode 100644
index 0000000..10482bc
Binary files /dev/null and b/cw 9/textures/table/albedo.png differ
diff --git a/cw 9/textures/table/ao.png b/cw 9/textures/table/ao.png
new file mode 100644
index 0000000..f4815c7
Binary files /dev/null and b/cw 9/textures/table/ao.png differ
diff --git a/cw 9/textures/table/metallic.png b/cw 9/textures/table/metallic.png
new file mode 100644
index 0000000..f438d88
Binary files /dev/null and b/cw 9/textures/table/metallic.png differ
diff --git a/cw 9/textures/table/normal.png b/cw 9/textures/table/normal.png
new file mode 100644
index 0000000..8e0e0cd
Binary files /dev/null and b/cw 9/textures/table/normal.png differ
diff --git a/cw 9/textures/table/roughness.png b/cw 9/textures/table/roughness.png
new file mode 100644
index 0000000..d99875a
Binary files /dev/null and b/cw 9/textures/table/roughness.png differ