zaimplementowano_funkcje_renderujaca_monety

This commit is contained in:
s473595 2024-02-28 21:56:34 +01:00
parent a865001f9f
commit 612f160429
15 changed files with 26 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@ -46,8 +46,7 @@
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-28T08:58:43.519Z",
"EditorCaption": ""
"WhenOpened": "2024-02-28T08:58:43.519Z"
},
{
"$type": "Document",
@ -59,8 +58,7 @@
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAbAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-26T19:01:49.259Z",
"EditorCaption": ""
"WhenOpened": "2024-02-26T19:01:49.259Z"
},
{
"$type": "Document",
@ -72,8 +70,7 @@
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.vert",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAoAAAA9AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-26T19:01:39.656Z",
"EditorCaption": ""
"WhenOpened": "2024-02-26T19:01:39.656Z"
},
{
"$type": "Document",
@ -83,7 +80,7 @@
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAAIEAAAAAAAAAAAAowJkAAAAYAAAA",
"ViewState": "AQIAAAgBAAAAAAAAAADgvxwBAAABAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-02-25T17:55:58.673Z",
"EditorCaption": ""
@ -98,8 +95,7 @@
"RelativeToolTip": "projekt_grk\\src\\main.cpp",
"ViewState": "AQIAABcAAAAAAAAAAAAtwCYAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-26T20:07:44.538Z",
"EditorCaption": ""
"WhenOpened": "2024-02-26T20:07:44.538Z"
}
]
}

Binary file not shown.

Binary file not shown.

View File

@ -5,16 +5,16 @@ C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(1
C:\Users\maksg\Documents\Grafika_2024\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1):
zobacz poprzednią definicję „APIENTRY”
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(93,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(94,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(139,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(140,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(210,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(213,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(228,29): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(231,29): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -16,7 +16,6 @@
#include <string>
#include "SOIL/SOIL.h"
namespace texture {
GLuint mercury;
GLuint venus;
@ -139,7 +138,7 @@ void drawCylinder(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3
float time = glfwGetTime();
glm::mat4 modelMatrixForMultiplications = modelMatrix * glm::rotate(glm::mat4(1.0f), time * 1.0f, glm::vec3(0, 1, 0))
* glm::scale(glm::vec3(0.5f));
* glm::scale(glm::vec3(0.3f));
modelMatrix = modelMatrixForMultiplications;
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
@ -154,10 +153,21 @@ void drawCylinder(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3
Core::DrawContext(context);
}
void renderCoins() {
float xCordinates[30] = {
5.3f, 10.0f, -4.7f, 9.2f, 3.5f, -7.5f, 1.8f, 2.5f, 11.8f, -10.2f,
-4.5f, 6.7f, -6.7f, 5.5f, -0.1f, -9.2f, -6.8f, -9.7f, -12.9f, 5.0f,
12.2f, -7.4f, 2.4f, 12.3f, -4.1f, -5.7f, -5.5f, -3.6f, -2.5f, -7.6f
};
float zCordinates[30] = {
2.6f, 1.5f, 4.8f, 2.2f, -11.8f, 3.3f, 9.1f, -6.0f, -12.0f, 11.1f,
11.9f, 2.5f, 5.2f, 1.1f, -2.0f, -8.2f, -2.9f, -9.4f, 0.5f, -2.3f,
-1.0f, 1.0f, -4.2f, 7.3f, 10.0f, -12.6f, -5.9f, -2.7f, 12.8f, 2.3f
};
for (int i = 0;i < 30;i++) {
drawCylinder(cylinderContext, glm::translate(glm::vec3(xCordinates[i], 0.0f, zCordinates[i])), glm::vec3(1.0f, 1.0f, 0.0f));
}
}
void drawSun(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint textureID)
{
@ -275,8 +285,8 @@ void renderScene(GLFWwindow* window)
renderPlanets();
drawCylinder(cylinderContext, glm::translate(glm::vec3(5.0f, 0.0f, 0.0f)), glm::vec3(1.0f, 1.0f, 0.0f));
renderCoins();
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));
glm::mat4 specshipCameraRotrationMatrix = glm::mat4({