ostatnie poprawki

This commit is contained in:
mikgaw@st.amu.edu.pl 2024-03-01 20:09:09 +01:00
parent 84061f9577
commit 492db3946f
43 changed files with 112 additions and 101 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,24 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\maksg\\Documents\\clone\\Grafika_2024\\",
"Documents": [],
"WorkspaceRootPath": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_pbr.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
@ -9,11 +26,63 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": -1,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "shader_5_1_tex_copy.vert",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ViewState": "AQIAAAkAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:58:34.685Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "shader_5_1_tex_copy.frag",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:58:31.038Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "shader_pbr.frag",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_pbr.frag",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_pbr.frag",
"ViewState": "AQIAABgAAAAAAAAAAAAowC0AAAAfAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:45:46.425Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "ex_7_1.hpp",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAAC4BAAAAAAAAAAAgwEMBAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-01T18:40:57.457Z",
"EditorCaption": ""
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,25 @@
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(531,5): warning MSB8028: Katalog pośredni (Debug\) zawiera pliki udostępnione z innego projektu (grk-cw3.vcxproj, grk-cw4.vcxproj, grk-cw5.vcxproj, grk-cw6.vcxproj, grk-cw7.vcxproj). Może to spowodować niepoprawne zachowanie podczas oczyszczania i ponownej kompilacji.
main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1):
zobacz poprzednią definicję „APIENTRY”
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(162,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(293,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(474,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(704,25): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(744,34): warning C4244: "=": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”
LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka
grk-cw7.vcxproj -> C:\Users\maksg\Documents\clone\Grafika_2024\Debug\projekt_grk.exe
grk-cw7.vcxproj -> D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\Debug\projekt_grk.exe

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\maksg\Documents\clone\Grafika_2024\Debug\projekt_grk.exe</FullPath>
<FullPath>D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\Debug\projekt_grk.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

View File

@ -1,10 +1,10 @@
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\Box.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\Box.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\Camera.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\Camera.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\main.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\main.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\Render_Utils.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\Render_Utils.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\Shader_Loader.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\Shader_Loader.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\SOIL\image_DXT.c;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\image_DXT.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\SOIL\image_helper.c;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\image_helper.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\SOIL\SOIL.c;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\SOIL.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\SOIL\stb_image_aug.c;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\stb_image_aug.obj
C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\src\Texture.cpp;C:\Users\maksg\Documents\clone\Grafika_2024\projekt_grk\Debug\Texture.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Box.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Box.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Camera.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Camera.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\main.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\main.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Render_Utils.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Render_Utils.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Shader_Loader.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Shader_Loader.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\image_DXT.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\image_DXT.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\image_helper.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\image_helper.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\SOIL.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\SOIL.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\stb_image_aug.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\stb_image_aug.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Texture.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Texture.obj

View File

@ -1 +1 @@
^C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\BOX.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\CAMERA.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_DXT.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_HELPER.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\MAIN.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\RENDER_UTILS.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SHADER_LOADER.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SOIL.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\STB_IMAGE_AUG.OBJ|C:\USERS\MAKSG\DOCUMENTS\CLONE\GRAFIKA_2024\PROJEKT_GRK\DEBUG\TEXTURE.OBJ
^D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\BOX.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\CAMERA.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_DXT.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_HELPER.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\MAIN.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\RENDER_UTILS.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SHADER_LOADER.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SOIL.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\STB_IMAGE_AUG.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\TEXTURE.OBJ

View File

@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22621.0:
Debug|Win32|C:\Users\maksg\Documents\clone\Grafika_2024\|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22000.0:
Debug|Win32|D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -58,7 +58,7 @@
<ProjectGuid>{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>grk-cw7</RootNamespace>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
<ProjectName>projekt_grk</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@ -1,7 +1,6 @@
#version 430 core
const float DIFFUSE_INTENSITY = 0.6;
const float MAX_RENDER_DISTANCE = 16.0;
float surfaceRoughness;
float metalnessValue;
@ -64,10 +63,6 @@ void main() {
vec3 diffuseReflectance = vec3(1.0) - fresnelTerm;
vec3 BRDF = diffuseReflectance * (textureColor / 3.1458493) + specular;
if (distanceToCamera > MAX_RENDER_DISTANCE) {
discard;
}
float diffuse = max(0.0001, dot(normal, lightDir));
fragmentColor = vec4(BRDF * (DIFFUSE_INTENSITY + diffuse) * 1.5, 1.0);

View File

@ -97,8 +97,8 @@ float zCordinatesOfCoin[maxSize] = {
float xCordinatesOfCollectedCoin[maxSize] = {};
float zCordinatesOfCollectedCoin[maxSize] = {};
float angleSpeed = 0.005f;
float moveSpeed = 0.0035f;
float angleSpeed = 0.01f;
float moveSpeed = 0.009f;
struct Planet {
glm::vec3 currentPos;
@ -436,78 +436,6 @@ void drawSpaceShip(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint t
}
void renderPlanet(float time, float orbitRadius, float orbitRotationSpeed, float selfRotationSpeed, float scale, GLuint planetTexture, GLuint normalTexture) {
glm::mat4 planetTransform = glm::rotate(glm::mat4(1.0f), time * orbitRotationSpeed, glm::vec3(0, 1, 0)) // orbitowanie dooko<6B>a s<>o<EFBFBD>ca
* glm::translate(glm::vec3(orbitRadius, 0, 0)) // translacja na odp. odleg<65>o<EFBFBD><6F>
* glm::rotate(glm::mat4(1.0f), time * selfRotationSpeed, glm::vec3(0, 1, 0)) //obr<62>t planety wok<6F> w<>asnej osi
* glm::scale(glm::vec3(scale)); //skalowanie planety
drawObjectTexture(sphereContext, planetTransform, planetTexture, normalTexture);
}
void renderPlanets() {
float time = 0;
//float time = glfwGetTime();
float mercuryOrbitRadius = 1.3f;
float venusOrbitRadius = 2.0f;
float earthOrbitRadius = 5.0f;
float moonOrbitRadius = 0.8f;
float marsOrbitRadius = 8.0f;
float jupiterOrbitRadius = 10.0f;
float saturnOrbitRadius = 11.0f;
float uranusOrbitRadius = 12.5f;
float neptuneOrbitRadius = 13.0f;
// im mniejsze tym szybciej
float mercuryRotationSpeed = 1.0f / 10;
float venusRotationSpeed = 1.0f / 7;
float earthRotationSpeed = 1.0f / 6;
float moonRotationSpeed = 1.0f / 2;
float marsRotationSpeed = 1.0f / 5;
float jupiterRotationSpeed = 1.0f / 8.5;
float saturnRotationSpeed = 1.0f / 5;
float uranusRotationSpeed = 1.0f / 9;
float neptuneRotationSpeed = 1.0f / 10;
float mercurySelfRotationSpeed = 1.0f;
float venusSelfRotationSpeed = 1.0f;
float earthSelfRotationSpeed = 1.0f;
float moonSelfRotationSpeed = 1.0f / 2;
float marsSelfRotationSpeed = 1.0f;
float jupiterSelfRotationSpeed = 1.0f;
float saturnSelfRotationSpeed = 1.0f;
float uranusSelfRotationSpeed = 1.0f / 2;
float neptuneSelfRotationSpeed = 1.0f;
float mercuryScale = 0.11f;
float venusScale = 0.14f;
float earthScale = 0.3f;
float moonScale = 0.055f;
float marsScale = 0.2f;
float jupiterScale = 0.7f;
float saturnScale = 0.5f;
float uranusScale = 0.3f;
float neptuneScale = 0.32f;
renderPlanet(time, mercuryOrbitRadius, mercuryRotationSpeed, mercurySelfRotationSpeed, mercuryScale, texture::mercury, texture::mercuryNormal);
renderPlanet(time, venusOrbitRadius, venusRotationSpeed, venusSelfRotationSpeed, venusScale, texture::venus, texture::venusNormal);
renderPlanet(time, earthOrbitRadius, earthRotationSpeed, earthSelfRotationSpeed, earthScale, texture::earth, texture::earthNormal);
//earths moon, musi by<62> inaczej renderowany bo on nie orbituje wok<6F> s<>o<EFBFBD>ca tylko ziemi. P<>niej to mo<6D>na jako<6B> lepiej rozwi<77>za<7A>.
drawObjectTexture(sphereContext,
glm::eulerAngleY(time * earthRotationSpeed) * glm::translate(glm::vec3(earthOrbitRadius, 0, 0)) * glm::eulerAngleY(time * moonRotationSpeed) * glm::translate(glm::vec3(moonOrbitRadius, 0, 0)) * glm::scale(glm::vec3(moonScale)),
texture::moon,
texture::asteroidNormal);
renderPlanet(time, marsOrbitRadius, marsRotationSpeed, marsSelfRotationSpeed, marsScale, texture::mars, texture::marsNormal);
renderPlanet(time, jupiterOrbitRadius, jupiterRotationSpeed, jupiterSelfRotationSpeed, jupiterScale, texture::jupiter, texture::jupiterNormal);
renderPlanet(time, saturnOrbitRadius, saturnRotationSpeed, saturnSelfRotationSpeed, saturnScale, texture::saturn, texture::saturnNormal);
renderPlanet(time, uranusOrbitRadius, uranusRotationSpeed, uranusSelfRotationSpeed, uranusScale, texture::uranus, texture::uranusNormal);
renderPlanet(time, neptuneOrbitRadius, neptuneRotationSpeed, neptuneSelfRotationSpeed, neptuneScale, texture::neptune, texture::neptuneNormal);
}
void initializePlanets() {
planets.push_back(Planet{ glm::vec3(2.0f, 0, 0), glm::vec3(0.11f), 1 / 59.0f, 1.0f / 2, 2.0f, texture::mercury, texture::mercuryNormal });
planets.push_back(Planet{ glm::vec3(3.5f, 0, 0), glm::vec3(0.29f), 1 / 243.0f, 1.0f / 5, 3.5f, texture::venus, texture::venusNormal });
@ -561,7 +489,7 @@ void renderScene(GLFWwindow* window)
for (auto& planet : planets) {
glm::mat4 modelMatrix = glm::rotate(glm::mat4(1.0f), 5*time * planet.orbitSpeed, glm::vec3(0, 1, 0)) // orbitowanie dooko³a s³oñca
glm::mat4 modelMatrix = glm::rotate(glm::mat4(1.0f), time * planet.orbitSpeed, glm::vec3(0, 1, 0)) // orbitowanie dooko豉 s這鎍a
* glm::translate(glm::vec3(planet.orbitRadius, 0, 0)) // translacja na odp. odleg³oœæ
* glm::rotate(glm::mat4(1.0f), time * planet.rotationSpeed, glm::vec3(0, 1, 0)) //obrót planety wokó³ w³asnej osi
* glm::scale(glm::vec3(planet.modelScale)); //skalowanie planety
@ -744,8 +672,6 @@ void processInput(GLFWwindow* window)
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 spaceshipUp = glm::vec3(0.f, 1.f, 0.f);
//float angleSpeed = 0.005f;
//float moveSpeed = 0.0025f;
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) {
glfwSetWindowShouldClose(window, true);
}