16 Commits

Author SHA1 Message Date
9a08770e6f przywrócenie trybu wydajności (jako komentarz), uprzątnięcie kodu 2025-01-08 05:38:53 +01:00
0725312d80 Merge remote-tracking branch 'origin/Sterowanie_na_3' into Sterowanie_na_3 2025-01-08 05:10:12 +01:00
395b470b5d dodanie textur 2025-01-08 04:55:58 +01:00
Pc
fa824192b7 To co w nazwie brancha + konsola w vsc 2025-01-07 23:16:46 +01:00
Pc
79c6a1e144 Klasa do fps + Limit Fps 2025-01-07 23:01:34 +01:00
Pc
01d7766b6a Sterowanie 5.0 + Klasa do fps 2025-01-07 22:20:22 +01:00
Pc
3171ebe504 Sterowanie 5.0 ? 2025-01-07 21:32:32 +01:00
Pc
039435ed73 Sterowanie na ocene chyba 5.0 ? 2025-01-07 21:25:14 +01:00
Pc
2afc119bb9 Sterowanie na ocene chyba 4.0 2025-01-07 20:49:20 +01:00
Pc
4956d74c1a Sterowanie na 3.0 2025-01-06 21:12:35 +01:00
495ec2e6ab nowa mapka (mapk2.obj) 2024-12-09 12:25:08 +01:00
633be80ec4 lekko poprawiona mapka, dodane nowe klasy do projektu w visual studio, oddzielny kolor dla mapki i łazika 2024-12-08 16:00:25 +01:00
2b51e31307 próba modularyzacji kodu, dodane klasy lazik oraz plane
- Makefile uwzględnia glfw
- projekt w visual studio także powinien linkować glfw
- dodano plik .gitignore
- klasa lazik stworzona z myślą o łaziku
- bliźniaczo podobna klasa plane stworzona z myślą o mapie
- dodano surowy projekt mapy (res/models/mapka.obj)
- usunięto zbędną klasę sześcian oraz plik wykonywalny .exe
- funkcja timestampedCout() przeniesiona do plików timeh.cpp/.hpp, co pozwala na używanie jej wszędzie
- w main.cpp:
	- zakomentowano masę (niepotrzebnego)/przeniesionego kodu
	- tryb monitorowania wydajności wyłącza ValidateRect(), co wymusza ciągłe renderowanie nowych klatek. pozwala to oszacować wpływ zmian na wydajność programu.
2024-12-07 03:47:17 +01:00
ef1a8b225b poprawiony model łazika (lazik4.obj, stoi tyłem), prymitywany licznik fps 2024-11-29 01:50:22 +01:00
1f00df1842 Merge branch 'master' of ssh://gitea.7o7.cx:2223/sherl/grafikaKBT 2024-11-28 02:20:10 +01:00
2f8f14d279 poprawiona wydajność, zużycie RAMu 2024-11-28 02:19:26 +01:00
41 changed files with 2284887 additions and 412 deletions

15
.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
# Czarna lista plików przy commitowaniu
# (pliki do zignorowania przy udostępnianiu)
# folder z rzeczami z visual studio
.vs
# pliki wykonywalne, binarne
grafikaKBT
x64
output.exe
output2.exe
# obiekty testowe
res/models/lazik.obj
res/models/lazik2.obj
res/models/lazik4,5.obj

24
FPSCounter.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <iostream>
#include <chrono>
class FPSCounter {
public:
FPSCounter() : frameCount(0), lastTime(std::chrono::high_resolution_clock::now()) {}
void update() {
frameCount++;
auto currentTime = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = currentTime - lastTime;
if (elapsed.count() >= 1.0) {
double fps = frameCount / elapsed.count();
std::cout << "FPS: " << fps << std::endl;
frameCount = 0;
lastTime = currentTime;
}
}
private:
int frameCount;
std::chrono::time_point<std::chrono::high_resolution_clock> lastTime;
};

View File

@@ -1,12 +1,13 @@
# mingw-w64-x86_64-gcc-14.1.0-3 to ostatnia wspierana wersja gcc, w której można stosować wildcard'y "*.cpp"
CC = "C:\\msys64\\mingw64\\bin\\g++.exe"
CFLAGS = -I.
DEPS = -lglew32 -lopengl32 -lglu32 -lgdi32
DEPS = -lglew32 -lglfw3 -lopengl32 -lglu32 -lgdi32
LINK = -L. -DGLEW_STATIC
OUTPUT = output.exe
CPPSTD = c++17
default:
$(CC) -g *.cpp $(CFLAGS) $(DEPS) $(LINK) -static -static-libgcc -fno-keep-inline-dllexport -o $(OUTPUT)
$(CC) -g *.cpp $(CFLAGS) $(DEPS) $(LINK) -std=$(CPPSTD) -static -static-libgcc -fno-keep-inline-dllexport -Os -s -Wl,--build-id=none -o $(OUTPUT)
run: default
$(OUTPUT)

BIN
glfw3.dll Normal file

Binary file not shown.

View File

@@ -92,6 +92,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -116,18 +117,31 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FPSCounter.cpp" />
<ClCompile Include="glew.c" />
<ClCompile Include="lazik.cpp" />
<ClCompile Include="loadOBJ.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="szescian.cpp" />
<ClCompile Include="plane.cpp" />
<ClCompile Include="shader.cpp" />
<ClCompile Include="texture.cpp" />
<ClCompile Include="timeh.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="lazik.hpp" />
<ClInclude Include="loadOBJ.h" />
<ClInclude Include="plane.hpp" />
<ClInclude Include="RESOURCE.H" />
<ClInclude Include="szescian.h" />
<ClInclude Include="shader.hpp" />
<ClInclude Include="texture.hpp" />
<ClInclude Include="timeh.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="glfw3.dll" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -21,7 +21,19 @@
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="szescian.cpp">
<ClCompile Include="glew.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lazik.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="timeh.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="plane.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FPSCounter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@@ -32,8 +44,25 @@
<ClInclude Include="RESOURCE.H">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="szescian.h">
<ClInclude Include="plane.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="lazik.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="timeh.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="shader.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="texture.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="glfw3.dll">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>

107
lazik.cpp Normal file
View File

@@ -0,0 +1,107 @@
#include "lazik.hpp"
//lazik::lazik(float x, float y, float z, const char* modelpath, const char* texturepath) {
lazik::lazik(float x, float y, float z, const char* modelpath) {
this->c_x = x;
this->c_y = y;
this->c_z = z;
this->modelpath = modelpath;
// this->texturepath = texturepath;
timestampedCout("lazik.cpp: Zaladowano dane w konstruktorze.")
}
// void lazik::passProgramID(GLuint programID) {
// this->programID = programID;
// }
void lazik::loadModel() {
timestampedCout("lazik.cpp:");
std::cout << " Ladowanie modelu ze sciezki " << this->modelpath << "...\n";
bool res = loadOBJ(this->modelpath, this->vertices, this->uvs, this->normals);
if (res) timestampedCout("Pomyslnie zaladowano model lazika.")
else timestampedCout("Nie udalo sie zaladowac modelu lazika.");
//this->Texture = loadDDS(this->texturepath);
//timestampedCout("lazik.cpp: this->Texture = " << this->Texture);
//this->TextureID = glGetUniformLocation(this->programID, "myTextureSampler");
//timestampedCout("lazik.cpp: this->TextureID = " << this->TextureID);
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, this->vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, this->vertices.size() * sizeof(glm::vec3), &vertices[0], GL_STATIC_DRAW);
glGenBuffers(1, &uvbuffer);
glBindBuffer(GL_ARRAY_BUFFER, this->uvbuffer);
glBufferData(GL_ARRAY_BUFFER, this->uvs.size() * sizeof(glm::vec2), &uvs[0], GL_STATIC_DRAW);
}
void lazik::draw() {
// glEnable(GL_TEXTURE_2D);
// // Bind our texture in Texture Unit 0
// glActiveTexture(GL_TEXTURE0);
// glBindTexture(GL_TEXTURE_2D, Texture);
// // Set our "myTextureSampler" sampler to use Texture Unit 0
// glUniform1i(TextureID, 0);
// 1st attribute buffer: vertices
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, this->vertexbuffer);
glVertexAttribPointer(
0, // attribute
3, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
0, // stride
(void*)0 // array buffer offset
);
// 2nd attribute buffer: UVs
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, this->uvbuffer);
glVertexAttribPointer(
1, // attribute
2, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
0, // stride
(void*)0 // array buffer offset
);
// Draw vertices
glDrawArrays(GL_TRIANGLES, 0, this->vertices.size());
// glDisable(GL_TEXTURE_2D);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
}
void lazik::unload(){
glDeleteBuffers(1, &this->vertexbuffer);
glDeleteBuffers(1, &this->uvbuffer);
// glDeleteTextures(1, &this->Texture);
}
void lazik::moveX(float x){
// TODO: dodać timer do poniższych funkcji, aby czas przejścia z punktu A do B był uniezależniony od FPSów
timestampedCout("dummy moveX");
}
void lazik::moveY(float y){
timestampedCout("dummy moveY");
}
void lazik::moveZ(float z){
timestampedCout("dummy moveZ");
}
void lazik::moveXYZ(float x, float y, float z){
// TODO: modyfikować wektor z koordynatami oraz c_x, c_y, c_z
timestampedCout("dummy moveXYZ");
}

43
lazik.hpp Normal file
View File

@@ -0,0 +1,43 @@
#pragma once
#include <windows.h>
#include "GL/glew.h"
#include <gl/gl.h>
#include <gl/glu.h>
#include <vector>
#include <iostream>
#include "timeh.hpp"
#include "GL/glm/glm.hpp"
#include "loadOBJ.h"
#include "texture.hpp"
#include "shader.hpp"
class lazik {
private:
float c_x{0};
float c_y{0};
float c_z{0};
float rot_x{0};
float rot_y{0};
float rot_z{0};
std::vector <glm::vec3> vertices;
std::vector <glm::vec2> uvs;
std::vector <glm::vec3> normals; // Won't be used at the moment.
GLuint vertexbuffer;
GLuint uvbuffer;
const char* modelpath;
//GLuint programID;
//GLuint Texture;
//GLuint TextureID;
//const char* texturepath;
public:
// lazik(float x, float y, float z, const char* modelpath, const char* texturepath);
lazik(float x, float y, float z, const char* modelpath);
//void passProgramID(GLuint programID);
void loadModel();
void draw();
void unload();
void moveX(float x);
void moveY(float y);
void moveZ(float z);
void moveXYZ(float x, float y, float z);
};

View File

@@ -15,11 +15,15 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
return false;
}
int line = 0;
unsigned int line = 0;
unsigned int vs = 0;
unsigned int vts = 0;
unsigned int vns = 0;
unsigned int fs = 0;
char lineHeader[128];
while (1) {
char lineHeader[128];
// read the first word of the line
int res = fscanf(file, "%s", lineHeader);
if (res == EOF) break; // EOF = End Of File. Quit the loop.
@@ -30,23 +34,27 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
glm::vec3 vertex;
fscanf(file, "%f %f %f\n", &vertex.x, &vertex.y, &vertex.z);
temp_vertices.push_back(vertex);
vs++;
} else if (strcmp(lineHeader, "vt") == 0) {
glm::vec2 uv;
fscanf(file, "%f %f\n", &uv.x, &uv.y);
temp_uvs.push_back(uv);
vts++;
} else if (strcmp(lineHeader, "vn") == 0) {
glm::vec3 normal;
fscanf(file, "%f %f %f\n", &normal.x, &normal.y, &normal.z);
temp_normals.push_back(normal);
vns++;
} else if (strcmp(lineHeader, "f") == 0) {
unsigned int vertexIndex[3], uvIndex[3], normalIndex[3];
int matches = fscanf(file, "%d/%d/%d %d/%d/%d %d/%d/%d\n", &vertexIndex[0], &uvIndex[0], &normalIndex[0], &vertexIndex[1], &uvIndex[1], &normalIndex[1], &vertexIndex[2], &uvIndex[2], &normalIndex[2]);
fs++;
if (matches != 9){
printf("File can't be read by our simple parser. Try exporting with other options (%d matches on line %d)\n", matches, line);
@@ -64,6 +72,9 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
normalIndices.push_back(normalIndex[2]);
}
line++;
}
// For each vertex of each triangle
for (unsigned int i = 0; i < vertexIndices.size(); i++) {
unsigned int vertexIndex = vertexIndices[i];
@@ -79,9 +90,9 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
out_normals.push_back(vertex3);
}
line++;
fclose(file);
}
printf("(loadOBJ.cpp) Loaded file with %d v, %d vt, %d vn, %d f. %d lines total.\n", vs, vts, vns, fs, line);
return true;
}

939
main.cpp

File diff suppressed because it is too large Load Diff

Binary file not shown.

75
plane.cpp Normal file
View File

@@ -0,0 +1,75 @@
#include "plane.hpp"
plane::plane(float x, float y, float z, const char* modelpath){
this->c_x = x;
this->c_y = y;
this->c_z = z;
this->modelpath = modelpath;
timestampedCout("plane.cpp: Zaladowano dane w konstruktorze.")
}
void plane::loadModel() {
timestampedCout("plane.cpp:");
std::cout << " Ladowanie modelu ze sciezki " << this->modelpath << "...\n";
bool res = loadOBJ(this->modelpath, this->vertices, this->uvs, this->normals);
if (res) timestampedCout("Pomyslnie zaladowano model mapki.")
else timestampedCout("Nie udalo sie zaladowac modelu mapki.");
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, this->vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, this->vertices.size() * sizeof(glm::vec3), &vertices[0], GL_STATIC_DRAW);
glGenBuffers(1, &uvbuffer);
glBindBuffer(GL_ARRAY_BUFFER, this->uvbuffer);
glBufferData(GL_ARRAY_BUFFER, this->uvs.size() * sizeof(glm::vec2), &uvs[0], GL_STATIC_DRAW);
}
void plane::draw() {
// 1st attribute buffer: vertices
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, this->vertexbuffer);
glVertexAttribPointer(
0, // attribute
3, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
0, // stride
(void*)0 // array buffer offset
);
// 2nd attribute buffer: UVs
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, this->uvbuffer);
glVertexAttribPointer(
1, // attribute
2, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
0, // stride
(void*)0 // array buffer offset
);
// Draw vertices
glDrawArrays(GL_TRIANGLES, 0, this->vertices.size());
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
}
void plane::moveX(float x){
timestampedCout("dummy moveX");
}
void plane::moveY(float y){
timestampedCout("dummy moveY");
}
void plane::moveZ(float z){
timestampedCout("dummy moveZ");
}

34
plane.hpp Normal file
View File

@@ -0,0 +1,34 @@
#pragma once
#include <windows.h>
#include "GL/glew.h"
#include <gl/gl.h>
#include <gl/glu.h>
#include <vector>
#include <iostream>
#include "timeh.hpp"
#include "GL/glm/glm.hpp"
#include "loadOBJ.h"
#include "texture.hpp"
class plane {
private:
float c_x{0};
float c_y{0};
float c_z{0};
float rot_x{0};
float rot_y{0};
float rot_z{0};
std::vector <glm::vec3> vertices;
std::vector <glm::vec2> uvs;
std::vector <glm::vec3> normals; // Won't be used at the moment.
GLuint vertexbuffer;
GLuint uvbuffer;
const char* modelpath;
public:
plane(float x, float y, float z, const char* modelpath);
void loadModel();
void draw();
void moveX(float x);
void moveY(float y);
void moveZ(float z);
};

BIN
res/img/barnroof.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/brickwall.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/grass01.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/grass02.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/t01.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/t02.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
res/img/woodenTexture.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@@ -1,44 +1,47 @@
# Blender 4.2.1 LTS
# www.blender.org
o Cube
v 1.000000 1.000000 -1.000000
# Blender3D v249 OBJ File: untitled.blend
# www.blender3d.org
mtllib cube.mtl
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.875000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.375000 1.000000
vt 0.375000 0.750000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.375000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.625000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
s 0
f 5/1/1 3/2/1 1/3/1
f 3/2/2 8/4/2 4/5/2
f 7/6/3 6/7/3 8/8/3
f 2/9/4 8/10/4 6/11/4
f 1/3/5 4/5/5 2/9/5
f 5/12/6 2/9/6 6/7/6
f 5/1/1 7/13/1 3/2/1
f 3/2/2 7/14/2 8/4/2
f 7/6/3 5/12/3 6/7/3
f 2/9/4 4/5/4 8/10/4
f 1/3/5 3/2/5 4/5/5
f 5/12/6 1/3/6 2/9/6
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 0.748573 0.750412
vt 0.749279 0.501284
vt 0.999110 0.501077
vt 0.999455 0.750380
vt 0.250471 0.500702
vt 0.249682 0.749677
vt 0.001085 0.750380
vt 0.001517 0.499994
vt 0.499422 0.500239
vt 0.500149 0.750166
vt 0.748355 0.998230
vt 0.500193 0.998728
vt 0.498993 0.250415
vt 0.748953 0.250920
vn 0.000000 0.000000 -1.000000
vn -1.000000 -0.000000 -0.000000
vn -0.000000 -0.000000 1.000000
vn -0.000001 0.000000 1.000000
vn 1.000000 -0.000000 0.000000
vn 1.000000 0.000000 0.000001
vn 0.000000 1.000000 -0.000000
vn -0.000000 -1.000000 0.000000
usemtl Material_ray.png
s off
f 5/1/1 1/2/1 4/3/1
f 5/1/1 4/3/1 8/4/1
f 3/5/2 7/6/2 8/7/2
f 3/5/2 8/7/2 4/8/2
f 2/9/3 6/10/3 3/5/3
f 6/10/4 7/6/4 3/5/4
f 1/2/5 5/1/5 2/9/5
f 5/1/6 6/10/6 2/9/6
f 5/1/7 8/11/7 6/10/7
f 8/11/7 7/12/7 6/10/7
f 1/2/8 2/9/8 3/13/8
f 1/2/8 3/13/8 4/14/8

44
res/models/kostka.obj Normal file
View File

@@ -0,0 +1,44 @@
# Blender 4.2.1 LTS
# www.blender.org
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.875000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.375000 1.000000
vt 0.375000 0.750000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.375000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.625000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
s 0
f 5/1/1 3/2/1 1/3/1
f 3/2/2 8/4/2 4/5/2
f 7/6/3 6/7/3 8/8/3
f 2/9/4 8/10/4 6/11/4
f 1/3/5 4/5/5 2/9/5
f 5/12/6 2/9/6 6/7/6
f 5/1/1 7/13/1 3/2/1
f 3/2/2 7/14/2 8/4/2
f 7/6/3 5/12/3 6/7/3
f 2/9/4 4/5/4 8/10/4
f 1/3/5 3/2/5 4/5/5
f 5/12/6 1/3/6 2/9/6

View File

@@ -0,0 +1,44 @@
# Blender 4.2.1 LTS
# www.blender.org
o Cube
v 10.000000 10.000000 -10.000000
v 10.000000 -10.000000 -10.000000
v 10.000000 10.000000 10.000000
v 10.000000 -10.000000 10.000000
v -10.000000 10.000000 -10.000000
v -10.000000 -10.000000 -10.000000
v -10.000000 10.000000 10.000000
v -10.000000 -10.000000 10.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.500000 0.250000
vt 0.750000 0.500000
vt 0.500000 0.500000
vt 1.000000 0.750000
vt 0.750000 0.750000
vt 0.000000 0.500000
vt 0.250000 0.750000
vt 0.000000 0.750000
vt 0.500000 0.750000
vt 0.750000 1.000000
vt 0.500000 1.000000
vt 0.250000 0.500000
vt 0.750000 0.250000
vt 1.000000 0.500000
s 0
f 5/1/1 3/2/1 1/3/1
f 3/2/2 8/4/2 4/5/2
f 7/6/3 6/7/3 8/8/3
f 2/9/4 8/10/4 6/11/4
f 1/3/5 4/5/5 2/9/5
f 5/12/6 2/9/6 6/7/6
f 5/1/1 7/13/1 3/2/1
f 3/2/2 7/14/2 8/4/2
f 7/6/3 5/12/3 6/7/3
f 2/9/4 4/5/4 8/10/4
f 1/3/5 3/2/5 4/5/5
f 5/12/6 1/3/6 2/9/6

7421
res/models/lazik4.obj Normal file

File diff suppressed because it is too large Load Diff

89
res/models/mapka.obj Normal file
View File

@@ -0,0 +1,89 @@
# Blender 4.2.1 LTS
# www.blender.org
o Plane
v -25.000000 -0.200000 25.000000
v 275.000000 -0.200000 25.000000
v -25.000000 -0.200000 -275.000000
v 275.000000 -0.200000 -275.000000
vn -0.0000 1.0000 -0.0000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
s 0
f 2/1/1 3/2/1 1/3/1
f 2/1/1 4/4/1 3/2/1
o Cube
v -15.000000 0.000000 15.000000
v -15.000000 40.000000 15.000000
v -15.000000 0.000000 -35.000004
v -15.000000 40.000000 -35.000004
v 15.000000 0.000000 15.000000
v 15.000000 40.000000 15.000000
v 15.000000 0.000000 -35.000004
v 15.000000 40.000000 -35.000004
v 0.000000 52.654823 15.000000
v 0.000000 52.654823 -35.000004
v -15.000000 20.000000 -35.000004
v 0.000000 40.000000 -35.000004
v 15.000000 20.000000 -35.000004
v 0.000000 20.000000 -35.000004
v -15.000000 10.000000 -35.000004
v -7.500000 20.000000 -35.000004
v 15.000000 10.000000 -35.000004
v 7.500000 20.000000 -35.000004
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.6448 0.7643 -0.0000
vn 0.6448 0.7643 -0.0000
vt 0.625000 0.000000
vt 0.500000 0.250000
vt 0.437500 0.250000
vt 0.625000 0.375000
vt 0.500000 0.500000
vt 0.500000 0.437500
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.375000 1.000000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 0.437500 0.500000
vt 0.625000 0.250000
vt 0.500000 0.375000
vt 0.500000 0.312500
vt 0.375000 0.250000
vt 0.750000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.000000
vt 0.375000 0.500000
vt 0.625000 1.000000
s 0
f 6/5/2 15/6/2 19/7/2
f 16/8/3 17/9/3 22/10/3
f 17/9/4 10/11/4 9/12/4
f 10/11/5 5/13/5 9/12/5
f 13/14/6 8/15/6 6/15/6
f 21/16/3 22/10/3 17/9/3
f 8/17/3 18/18/3 20/19/3
f 19/7/3 20/19/3 7/20/3
f 16/8/3 14/21/3 12/22/3
f 12/22/7 13/14/7 10/11/7
f 6/15/5 10/11/5 13/14/5
f 7/20/2 5/23/2 6/5/2
f 6/5/2 8/17/2 15/6/2
f 19/7/2 7/20/2 6/5/2
f 22/10/3 18/18/3 16/8/3
f 16/8/3 12/22/3 17/9/3
f 9/12/4 11/24/4 21/16/4
f 17/9/4 12/22/4 10/11/4
f 9/12/4 21/16/4 17/9/4
f 10/11/5 6/25/5 5/13/5
f 13/14/6 14/21/6 8/15/6
f 21/16/3 11/24/3 22/10/3
f 20/19/3 15/6/3 8/17/3
f 8/17/3 16/8/3 18/18/3
f 19/7/3 15/6/3 20/19/3
f 16/8/3 8/15/3 14/21/3
f 12/22/7 14/21/7 13/14/7

1101
res/models/mapka2.obj Normal file

File diff suppressed because it is too large Load Diff

2274083
res/models/mapka3.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,267 @@
# Blender 4.2.1 LTS
# www.blender.org
o platforma
v -10.000000 0.000000 110.000000
v -10.000000 -2.000000 110.000000
v -10.000000 0.000000 -20.000000
v -10.000000 -2.000000 -20.000000
v 110.000000 0.000000 110.000000
v 110.000000 -2.000000 110.000000
v 110.000000 0.000000 -20.000000
v 110.000000 -2.000000 -20.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vt 0.875000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.375000 1.000000
vt 0.375000 0.750000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.375000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.625000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
s 0
f 5/1/1 3/2/1 1/3/1
f 3/2/2 8/4/2 4/5/2
f 7/6/3 6/7/3 8/8/3
f 2/9/4 8/10/4 6/11/4
f 1/3/5 4/5/5 2/9/5
f 5/12/6 2/9/6 6/7/6
f 5/1/1 7/13/1 3/2/1
f 3/2/2 7/14/2 8/4/2
f 7/6/3 5/12/3 6/7/3
f 2/9/4 4/5/4 8/10/4
f 1/3/5 3/2/5 4/5/5
f 5/12/6 1/3/6 2/9/6
o szopa
v 10.000000 0.000000 -19.000000
v 10.000000 21.000000 -19.000000
v 10.000000 0.000000 -1.000000
v 10.000000 21.000000 -1.000000
v -9.000000 0.000000 -19.000000
v -9.000000 21.000000 -19.000000
v -9.000000 0.000000 -1.000000
v -9.000000 21.000000 -1.000000
v 10.000000 0.000000 -3.000000
v 10.000000 0.000000 -17.000000
v 10.000000 2.333333 -19.000000
v 10.000000 4.666667 -19.000000
v 10.000000 7.000000 -19.000000
v 10.000000 9.333334 -19.000000
v 10.000000 11.666667 -19.000000
v 10.000000 14.000000 -19.000000
v 10.000000 16.333334 -19.000000
v 10.000000 18.666668 -19.000000
v 10.000000 21.000000 -17.000000
v 10.000000 21.000000 -15.000000
v 10.000000 21.000000 -13.000000
v 10.000000 21.000000 -11.000000
v 10.000000 21.000000 -9.000000
v 10.000000 21.000000 -7.000000
v 10.000000 21.000000 -5.000000
v 10.000000 21.000000 -3.000000
v 10.000000 18.666668 -1.000000
v 10.000000 16.333334 -1.000000
v 10.000000 14.000000 -1.000000
v 10.000000 11.666666 -1.000000
v 10.000000 9.333333 -1.000000
v 10.000000 7.000000 -1.000000
v 10.000000 4.666667 -1.000000
v 10.000000 2.333333 -1.000000
v 10.000000 2.333333 -17.000000
v 10.000000 2.333333 -3.000000
v 10.000000 4.666667 -17.000000
v 10.000000 4.666667 -3.000000
v 10.000000 7.000000 -17.000000
v 10.000000 7.000000 -3.000000
v 10.000000 9.333334 -17.000000
v 10.000000 9.333334 -15.000000
v 10.000000 9.333333 -5.000000
v 10.000000 9.333333 -3.000000
v 10.000000 11.666667 -17.000000
v 10.000000 11.666667 -15.000000
v 10.000000 11.666667 -13.000000
v 10.000000 11.666667 -11.000000
v 10.000000 11.666667 -9.000000
v 10.000000 11.666667 -7.000000
v 10.000000 11.666667 -5.000000
v 10.000000 11.666666 -3.000000
v 10.000000 21.000000 -19.000000
v 10.000000 21.000000 -1.000000
v -9.000000 21.000000 -19.000000
v -9.000000 21.000000 -1.000000
v 10.000000 32.000000 -10.000000
v -9.000000 32.000000 -10.000000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 0.6332 -0.7740
vn -0.0000 0.6332 0.7740
vt 0.513889 0.250000
vt 0.541667 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.486111 1.000000
vt 0.458333 1.000000
vt 0.486111 0.000000
vt 0.486111 0.027778
vt 0.458333 0.027778
vt 0.486111 0.222222
vt 0.458333 0.222222
vt 0.486111 0.194444
vt 0.513889 0.027778
vt 0.486111 0.055556
vt 0.513889 0.194444
vt 0.486111 0.250000
vt 0.458333 0.250000
vt 0.000000 0.000000
vt 0.513889 0.055556
vt 0.541667 0.000000
vt 0.625000 0.027778
vt 0.001001 0.997998
vt 0.001001 0.501001
vt 0.497998 0.501001
vt 0.498999 0.502002
vt 0.498999 0.998999
vt 0.002002 0.998999
vt 0.501001 0.001001
vt 0.998999 0.498999
vt 0.998999 0.001001
vt 0.001001 0.001001
vt 0.498999 0.498999
vt 0.498999 0.001001
vt 0.375000 0.250000
vt 0.402778 0.250000
vt 0.430556 0.250000
vt 0.625000 0.250000
vt 0.597222 0.250000
vt 0.569444 0.250000
vt 0.375000 1.000000
vt 0.625000 1.000000
vt 0.597222 1.000000
vt 0.569444 1.000000
vt 0.402778 1.000000
vt 0.430556 1.000000
vt 0.541667 1.000000
vt 0.513889 1.000000
vt 0.375000 0.027778
vt 0.375000 0.000000
vt 0.402778 0.000000
vt 0.430556 0.000000
vt 0.402778 0.027778
vt 0.458333 0.000000
vt 0.430556 0.027778
vt 0.513889 0.000000
vt 0.513889 0.222222
vt 0.375000 0.222222
vt 0.402778 0.222222
vt 0.430556 0.222222
vt 0.625000 0.222222
vt 0.625000 0.194444
vt 0.625000 0.166667
vt 0.513889 0.166667
vt 0.625000 0.138889
vt 0.625000 0.111111
vt 0.513889 0.138889
vt 0.513889 0.111111
vt 0.625000 0.083333
vt 0.625000 0.055556
vt 0.513889 0.083333
vt 0.597222 0.000000
vt 0.625000 0.000000
vt 0.569444 0.000000
vt 0.501001 0.498999
vt 0.001001 0.498999
s 0
f 38/15/7 37/16/7 15/17/7
f 16/18/8 13/19/8 15/17/8
f 14/20/9 22/21/9 21/22/9
f 22/23/10 49/24/10 47/25/10
f 52/26/10 48/27/10 51/28/10
f 53/29/10 50/30/10 49/24/10
f 59/31/10 52/26/10 51/28/10
f 52/26/10 39/32/10 40/33/10
f 50/30/10 47/25/10 49/24/10
f 56/34/10 50/30/10 54/35/10
f 51/28/10 57/34/10 59/31/10
f 53/29/10 24/36/10 27/37/10
f 61/38/10 65/39/10 62/40/10
f 64/41/8 66/42/8 63/43/8
f 66/44/11 61/45/11 63/46/11
f 62/47/12 66/48/12 64/49/12
f 15/17/7 11/50/7 42/51/7
f 15/17/7 42/51/7 41/52/7
f 12/53/7 16/18/7 15/17/7
f 35/54/7 12/53/7 15/17/7
f 15/17/7 41/52/7 40/33/7
f 15/17/7 40/33/7 39/32/7
f 36/55/7 35/54/7 15/17/7
f 37/16/7 36/55/7 15/17/7
f 15/17/7 39/32/7 38/15/7
f 16/18/8 14/20/8 13/19/8
f 9/56/9 13/19/9 14/20/9
f 14/20/9 10/57/9 26/58/9
f 14/20/9 26/58/9 25/59/9
f 19/60/9 9/56/9 14/20/9
f 20/61/9 19/60/9 14/20/9
f 14/20/9 25/59/9 24/62/9
f 14/20/9 24/62/9 23/63/9
f 21/22/9 20/61/9 14/20/9
f 14/20/9 23/63/9 22/21/9
f 18/64/10 9/65/10 19/66/10
f 18/64/10 19/66/10 20/67/10
f 43/68/10 18/64/10 20/67/10
f 43/68/10 20/67/10 21/69/10
f 45/70/10 43/68/10 21/69/10
f 22/23/10 23/71/10 53/29/10
f 45/70/10 21/69/10 22/23/10
f 47/25/10 45/70/10 22/23/10
f 22/23/10 53/29/10 49/24/10
f 53/29/10 54/35/10 50/30/10
f 59/31/10 60/72/10 52/26/10
f 11/50/10 17/73/10 44/74/10
f 11/50/10 44/74/10 46/75/10
f 42/51/10 11/50/10 46/75/10
f 42/51/10 46/75/10 48/27/10
f 41/52/10 42/51/10 48/27/10
f 52/26/10 60/72/10 38/15/10
f 41/52/10 48/27/10 52/26/10
f 40/33/10 41/52/10 52/26/10
f 52/26/10 38/15/10 39/32/10
f 34/76/10 12/53/10 35/54/10
f 34/76/10 35/54/10 36/55/10
f 33/77/10 34/76/10 36/55/10
f 37/16/10 38/15/10 60/72/10
f 33/77/10 36/55/10 37/16/10
f 32/78/10 33/77/10 37/16/10
f 37/16/10 60/72/10 59/31/10
f 37/16/10 59/31/10 58/79/10
f 31/80/10 32/78/10 37/16/10
f 30/81/10 31/80/10 37/16/10
f 37/16/10 58/79/10 57/82/10
f 37/16/10 57/82/10 56/83/10
f 29/84/10 30/81/10 37/16/10
f 28/85/10 29/84/10 37/16/10
f 37/16/10 56/83/10 55/86/10
f 37/16/10 55/86/10 54/35/10
f 27/37/10 28/85/10 37/16/10
f 26/87/10 10/88/10 27/37/10
f 25/89/10 26/87/10 27/37/10
f 27/37/10 37/16/10 54/35/10
f 53/29/10 23/71/10 24/36/10
f 27/37/10 54/35/10 53/29/10
f 24/36/10 25/89/10 27/37/10
f 66/44/11 65/90/11 61/45/11
f 62/47/12 65/91/12 66/48/12

View File

@@ -0,0 +1,225 @@
# Blender 4.2.1 LTS
# www.blender.org
o szopa
v 10.000000 0.000000 -19.000000
v 10.000000 21.000000 -19.000000
v 10.000000 0.000000 -1.000000
v 10.000000 21.000000 -1.000000
v -9.000000 0.000000 -19.000000
v -9.000000 21.000000 -19.000000
v -9.000000 0.000000 -1.000000
v -9.000000 21.000000 -1.000000
v 10.000000 0.000000 -3.000000
v 10.000000 0.000000 -17.000000
v 10.000000 2.333333 -19.000000
v 10.000000 4.666667 -19.000000
v 10.000000 7.000000 -19.000000
v 10.000000 9.333334 -19.000000
v 10.000000 11.666667 -19.000000
v 10.000000 14.000000 -19.000000
v 10.000000 16.333334 -19.000000
v 10.000000 18.666668 -19.000000
v 10.000000 21.000000 -17.000000
v 10.000000 21.000000 -15.000000
v 10.000000 21.000000 -13.000000
v 10.000000 21.000000 -11.000000
v 10.000000 21.000000 -9.000000
v 10.000000 21.000000 -7.000000
v 10.000000 21.000000 -5.000000
v 10.000000 21.000000 -3.000000
v 10.000000 18.666668 -1.000000
v 10.000000 16.333334 -1.000000
v 10.000000 14.000000 -1.000000
v 10.000000 11.666666 -1.000000
v 10.000000 9.333333 -1.000000
v 10.000000 7.000000 -1.000000
v 10.000000 4.666667 -1.000000
v 10.000000 2.333333 -1.000000
v 10.000000 2.333333 -17.000000
v 10.000000 2.333333 -3.000000
v 10.000000 4.666667 -17.000000
v 10.000000 4.666667 -3.000000
v 10.000000 7.000000 -17.000000
v 10.000000 7.000000 -3.000000
v 10.000000 9.333334 -17.000000
v 10.000000 9.333334 -15.000000
v 10.000000 9.333333 -5.000000
v 10.000000 9.333333 -3.000000
v 10.000000 11.666667 -17.000000
v 10.000000 11.666667 -15.000000
v 10.000000 11.666667 -13.000000
v 10.000000 11.666667 -11.000000
v 10.000000 11.666667 -9.000000
v 10.000000 11.666667 -7.000000
v 10.000000 11.666667 -5.000000
v 10.000000 11.666666 -3.000000
v 10.000000 21.000000 -19.000000
v 10.000000 21.000000 -1.000000
v -9.000000 21.000000 -19.000000
v -9.000000 21.000000 -1.000000
v 10.000000 32.000000 -10.000000
v -9.000000 32.000000 -10.000000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 0.6332 -0.7740
vn -0.0000 0.6332 0.7740
vt 0.513889 0.250000
vt 0.541667 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.486111 1.000000
vt 0.458333 1.000000
vt 0.486111 0.000000
vt 0.486111 0.027778
vt 0.458333 0.027778
vt 0.486111 0.222222
vt 0.458333 0.222222
vt 0.486111 0.194444
vt 0.513889 0.027778
vt 0.486111 0.055556
vt 0.513889 0.194444
vt 0.486111 0.250000
vt 0.458333 0.250000
vt 0.000000 0.000000
vt 0.513889 0.055556
vt 0.541667 0.000000
vt 0.625000 0.027778
vt 0.001001 0.997998
vt 0.001001 0.501001
vt 0.497998 0.501001
vt 0.498999 0.502002
vt 0.498999 0.998999
vt 0.002002 0.998999
vt 0.501001 0.001001
vt 0.998999 0.498999
vt 0.998999 0.001001
vt 0.001001 0.001001
vt 0.498999 0.498999
vt 0.498999 0.001001
vt 0.375000 0.250000
vt 0.402778 0.250000
vt 0.430556 0.250000
vt 0.625000 0.250000
vt 0.597222 0.250000
vt 0.569444 0.250000
vt 0.375000 1.000000
vt 0.625000 1.000000
vt 0.597222 1.000000
vt 0.569444 1.000000
vt 0.402778 1.000000
vt 0.430556 1.000000
vt 0.541667 1.000000
vt 0.513889 1.000000
vt 0.375000 0.027778
vt 0.375000 0.000000
vt 0.402778 0.000000
vt 0.430556 0.000000
vt 0.402778 0.027778
vt 0.458333 0.000000
vt 0.430556 0.027778
vt 0.513889 0.000000
vt 0.513889 0.222222
vt 0.375000 0.222222
vt 0.402778 0.222222
vt 0.430556 0.222222
vt 0.625000 0.222222
vt 0.625000 0.194444
vt 0.625000 0.166667
vt 0.513889 0.166667
vt 0.625000 0.138889
vt 0.625000 0.111111
vt 0.513889 0.138889
vt 0.513889 0.111111
vt 0.625000 0.083333
vt 0.625000 0.055556
vt 0.513889 0.083333
vt 0.597222 0.000000
vt 0.625000 0.000000
vt 0.569444 0.000000
vt 0.501001 0.498999
vt 0.001001 0.498999
s 0
f 30/1/1 29/2/1 7/3/1
f 8/4/2 5/5/2 7/3/2
f 6/6/3 14/7/3 13/8/3
f 14/9/4 41/10/4 39/11/4
f 44/12/4 40/13/4 43/14/4
f 45/15/4 42/16/4 41/10/4
f 51/17/4 44/12/4 43/14/4
f 44/12/4 31/18/4 32/19/4
f 42/16/4 39/11/4 41/10/4
f 48/20/4 42/16/4 46/21/4
f 43/14/4 49/20/4 51/17/4
f 45/15/4 16/22/4 19/23/4
f 53/24/4 57/25/4 54/26/4
f 56/27/2 58/28/2 55/29/2
f 58/30/5 53/31/5 55/32/5
f 54/33/6 58/34/6 56/35/6
f 7/3/1 3/36/1 34/37/1
f 7/3/1 34/37/1 33/38/1
f 4/39/1 8/4/1 7/3/1
f 27/40/1 4/39/1 7/3/1
f 7/3/1 33/38/1 32/19/1
f 7/3/1 32/19/1 31/18/1
f 28/41/1 27/40/1 7/3/1
f 29/2/1 28/41/1 7/3/1
f 7/3/1 31/18/1 30/1/1
f 8/4/2 6/6/2 5/5/2
f 1/42/3 5/5/3 6/6/3
f 6/6/3 2/43/3 18/44/3
f 6/6/3 18/44/3 17/45/3
f 11/46/3 1/42/3 6/6/3
f 12/47/3 11/46/3 6/6/3
f 6/6/3 17/45/3 16/48/3
f 6/6/3 16/48/3 15/49/3
f 13/8/3 12/47/3 6/6/3
f 6/6/3 15/49/3 14/7/3
f 10/50/4 1/51/4 11/52/4
f 10/50/4 11/52/4 12/53/4
f 35/54/4 10/50/4 12/53/4
f 35/54/4 12/53/4 13/55/4
f 37/56/4 35/54/4 13/55/4
f 14/9/4 15/57/4 45/15/4
f 37/56/4 13/55/4 14/9/4
f 39/11/4 37/56/4 14/9/4
f 14/9/4 45/15/4 41/10/4
f 45/15/4 46/21/4 42/16/4
f 51/17/4 52/58/4 44/12/4
f 3/36/4 9/59/4 36/60/4
f 3/36/4 36/60/4 38/61/4
f 34/37/4 3/36/4 38/61/4
f 34/37/4 38/61/4 40/13/4
f 33/38/4 34/37/4 40/13/4
f 44/12/4 52/58/4 30/1/4
f 33/38/4 40/13/4 44/12/4
f 32/19/4 33/38/4 44/12/4
f 44/12/4 30/1/4 31/18/4
f 26/62/4 4/39/4 27/40/4
f 26/62/4 27/40/4 28/41/4
f 25/63/4 26/62/4 28/41/4
f 29/2/4 30/1/4 52/58/4
f 25/63/4 28/41/4 29/2/4
f 24/64/4 25/63/4 29/2/4
f 29/2/4 52/58/4 51/17/4
f 29/2/4 51/17/4 50/65/4
f 23/66/4 24/64/4 29/2/4
f 22/67/4 23/66/4 29/2/4
f 29/2/4 50/65/4 49/68/4
f 29/2/4 49/68/4 48/69/4
f 21/70/4 22/67/4 29/2/4
f 20/71/4 21/70/4 29/2/4
f 29/2/4 48/69/4 47/72/4
f 29/2/4 47/72/4 46/21/4
f 19/23/4 20/71/4 29/2/4
f 18/73/4 2/74/4 19/23/4
f 17/75/4 18/73/4 19/23/4
f 19/23/4 29/2/4 46/21/4
f 45/15/4 15/57/4 16/22/4
f 19/23/4 46/21/4 45/15/4
f 16/22/4 17/75/4 19/23/4
f 58/30/5 57/76/5 53/31/5
f 54/33/6 57/77/6 58/34/6

BIN
res/models/uvmap.DDS Normal file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
#version 330 core
// Interpolated values from the vertex shaders
in vec2 UV;
// Output data
out vec3 color;
// Values that stay constant for the whole mesh.
uniform sampler2D myTextureSampler;
void main() {
// Output color = color of the texture at the specified UV
color = texture(myTextureSampler, UV).rgb;
}

View File

@@ -0,0 +1,20 @@
#version 330 core
// Input vertex data, different for all executions of this shader.
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec2 vertexUV;
// Output data; will be interpolated for each fragment.
out vec2 UV;
// Values that stay constant for the whole mesh.
uniform mat4 MVP;
void main() {
// Output position of the vertex, in clip space: MVP * position
gl_Position = MVP * vec4(vertexPosition_modelspace, 1);
// UV of the vertex. No special space for this one.
UV = vertexUV;
}

94
shader.cpp Normal file
View File

@@ -0,0 +1,94 @@
#include "shader.hpp"
GLuint LoadShaders(const char * vertex_file_path, const char * fragment_file_path) {
// Create the shaders
GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
GLuint FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
// Read the Vertex Shader code from the file
std::string VertexShaderCode;
std::ifstream VertexShaderStream(vertex_file_path, std::ios::in);
if (VertexShaderStream.is_open()) {
std::stringstream sstr;
sstr << VertexShaderStream.rdbuf();
VertexShaderCode = sstr.str();
VertexShaderStream.close();
} else {
timestampedCout("shader.cpp: Impossible to open " << vertex_file_path << ". Are you in the right directory?");
return 0;
}
// Read the Fragment Shader code from the file
std::string FragmentShaderCode;
std::ifstream FragmentShaderStream(fragment_file_path, std::ios::in);
if(FragmentShaderStream.is_open()){
std::stringstream sstr;
sstr << FragmentShaderStream.rdbuf();
FragmentShaderCode = sstr.str();
FragmentShaderStream.close();
}
GLint Result = GL_FALSE;
int InfoLogLength;
// Compile Vertex Shader
timestampedCout("shader.cpp: Compiling shader: " << vertex_file_path << "...");
char const * VertexSourcePointer = VertexShaderCode.c_str();
glShaderSource(VertexShaderID, 1, &VertexSourcePointer , NULL);
glCompileShader(VertexShaderID);
// Check Vertex Shader
glGetShaderiv(VertexShaderID, GL_COMPILE_STATUS, &Result);
glGetShaderiv(VertexShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength);
if (InfoLogLength > 0) {
std::vector<char> VertexShaderErrorMessage(InfoLogLength + 1);
glGetShaderInfoLog(VertexShaderID, InfoLogLength, NULL, &VertexShaderErrorMessage[0]);
timestampedCout("shader.cpp: VertexErrorMessage " << &VertexShaderErrorMessage[0]);
}
// Compile Fragment Shader
timestampedCout("shader.cpp: Compiling shader: " << fragment_file_path << "...");
char const * FragmentSourcePointer = FragmentShaderCode.c_str();
glShaderSource(FragmentShaderID, 1, &FragmentSourcePointer , NULL);
glCompileShader(FragmentShaderID);
// Check Fragment Shader
glGetShaderiv(FragmentShaderID, GL_COMPILE_STATUS, &Result);
glGetShaderiv(FragmentShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength);
if (InfoLogLength > 0) {
std::vector<char> FragmentShaderErrorMessage(InfoLogLength + 1);
glGetShaderInfoLog(FragmentShaderID, InfoLogLength, NULL, &FragmentShaderErrorMessage[0]);
timestampedCout("shader.cpp: FragmentShaderErrorMessage " << &FragmentShaderErrorMessage[0]);
}
// Link the program
timestampedCout("shader.cpp: Linking program...");
GLuint ProgramID = glCreateProgram();
glAttachShader(ProgramID, VertexShaderID);
glAttachShader(ProgramID, FragmentShaderID);
glLinkProgram(ProgramID);
// Check the program
glGetProgramiv(ProgramID, GL_LINK_STATUS, &Result);
glGetProgramiv(ProgramID, GL_INFO_LOG_LENGTH, &InfoLogLength);
if (InfoLogLength > 0){
std::vector<char> ProgramErrorMessage(InfoLogLength + 1);
glGetProgramInfoLog(ProgramID, InfoLogLength, NULL, &ProgramErrorMessage[0]);
timestampedCout("shader.cpp: ProgramErrorMessage " << &ProgramErrorMessage[0]);
}
glDetachShader(ProgramID, VertexShaderID);
glDetachShader(ProgramID, FragmentShaderID);
glDeleteShader(VertexShaderID);
glDeleteShader(FragmentShaderID);
return ProgramID;
}

16
shader.hpp Normal file
View File

@@ -0,0 +1,16 @@
#include <stdio.h>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <sstream>
using namespace std;
#include <stdlib.h>
#include <string.h>
#include "timeh.hpp"
#include "GL/glew.h"
GLuint LoadShaders(const char * vertex_file_path, const char * fragment_file_path);

View File

@@ -1,71 +0,0 @@
#include "szescian.h"
void szescian::create(float x, float y, float z, float KRAWEDZ) {
this->c_x = x;
this->c_y = y;
this->c_z = z;
// Parametry wierzcholkow
GLfloat sa[3] = { x + 0.0f, y + 0.0f, z + 0.0f };
GLfloat sb[3] = { x + KRAWEDZ, y + 0.0f, z + 0.0f };
GLfloat sc[3] = { x + KRAWEDZ, y + KRAWEDZ, z + 0.0f };
GLfloat sd[3] = { x + 0.0f, y + KRAWEDZ, z + 0.0f };
GLfloat se[3] = { x + 0.0f, y + 0.0f, z - KRAWEDZ };
GLfloat sf[3] = { x + KRAWEDZ, y + 0.0f, z - KRAWEDZ };
GLfloat sg[3] = { x + KRAWEDZ, y + KRAWEDZ, z - KRAWEDZ };
GLfloat sh[3] = { x + 0.0f, y + KRAWEDZ, z - KRAWEDZ };
// Sciany skladowe
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_POLYGON);
glVertex3fv(sa);
glVertex3fv(sb);
glVertex3fv(sc);
glVertex3fv(sd);
glEnd();
glColor3f(0.0f, 1.0f, 0.0f);
glBegin(GL_POLYGON);
glVertex3fv(sb);
glVertex3fv(sf);
glVertex3fv(sg);
glVertex3fv(sc);
glEnd();
glColor3f(0.0f, 0.0f, 1.0f);
glBegin(GL_POLYGON);
glVertex3fv(sf);
glVertex3fv(se);
glVertex3fv(sh);
glVertex3fv(sg);
glEnd();
glColor3f(1.0f, 1.0f, 0.0f);
glBegin(GL_POLYGON);
glVertex3fv(se);
glVertex3fv(sa);
glVertex3fv(sd);
glVertex3fv(sh);
glEnd();
glColor3f(0.0f, 1.0f, 1.0f);
glBegin(GL_POLYGON);
glVertex3fv(sd);
glVertex3fv(sc);
glVertex3fv(sg);
glVertex3fv(sh);
glEnd();
glColor3f(1.0f, 0.0f, 1.0f);
glBegin(GL_POLYGON);
glVertex3fv(sa);
glVertex3fv(sb);
glVertex3fv(sf);
glVertex3fv(se);
glEnd();
}

View File

@@ -1,14 +0,0 @@
#pragma once
#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
class szescian
{
private:
float c_x{0};
float c_y{0};
float c_z{0};
public:
void create(float x, float y, float z, float KRAWEDZ);
};

188
texture.cpp Normal file
View File

@@ -0,0 +1,188 @@
#include "texture.hpp"
GLuint loadBMP_custom(const char * imagepath){
return 0;
timestampedCout("texture.cpp: Reading image " << imagepath << "...");
// Data read from the header of the BMP file
unsigned char header[54];
unsigned int dataPos;
unsigned int imageSize;
unsigned int width, height;
// Actual RGB data
unsigned char * data;
// Open the file
FILE * file = fopen(imagepath, "rb");
if (!file) {
timestampedCout("texture.cpp: " << imagepath << " could not be opened. Are you in the right directory?");
return 0;
}
// Read the header, i.e. the 54 first bytes
// If less than 54 bytes are read, problem
if (fread(header, 1, 54, file) != 54) {
timestampedCout("texture.cpp: Not a correct BMP file.");
fclose(file);
return 0;
}
// A BMP files always begins with "BM"
if (header[0] != 'B' || header[1] != 'M') {
timestampedCout("texture.cpp: Not a correct BMP file.");
fclose(file);
return 0;
}
// Make sure this is a 24bpp file
if (*(int*)&(header[0x1E]) != 0) { timestampedCout("texture.cpp: Not a correct BMP file."); fclose(file); return 0;}
if (*(int*)&(header[0x1C]) != 24) { timestampedCout("texture.cpp: Not a correct BMP file."); fclose(file); return 0;}
// Read the information about the image
dataPos = *(int*)&(header[0x0A]);
imageSize = *(int*)&(header[0x22]);
width = *(int*)&(header[0x12]);
height = *(int*)&(header[0x16]);
// Some BMP files are misformatted, guess missing information
if (imageSize == 0) imageSize = width * height * 3; // 3 : one byte for each Red, Green and Blue component
if (dataPos == 0) dataPos = 54; // The BMP header is done that way
// Create a buffer
data = new unsigned char [imageSize];
// Read the actual data from the file into the buffer
fread(data, 1, imageSize, file);
// Everything is in memory now, the file can be closed.
fclose(file);
// Create one OpenGL texture
GLuint textureID;
glGenTextures(1, &textureID);
// "Bind" the newly created texture : all future texture functions will modify this texture
glBindTexture(GL_TEXTURE_2D, textureID);
// Give the image to OpenGL
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_BGR, GL_UNSIGNED_BYTE, data);
// OpenGL has now copied the data. Free our own version
delete [] data;
// Poor filtering, or ...
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// ... nice trilinear filtering ...
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
// ... which requires mipmaps. Generate them automatically.
glGenerateMipmap(GL_TEXTURE_2D);
// Return the ID of the texture we just created
return textureID;
}
#define FOURCC_DXT1 0x31545844 // Equivalent to "DXT1" in ASCII
#define FOURCC_DXT3 0x33545844 // Equivalent to "DXT3" in ASCII
#define FOURCC_DXT5 0x35545844 // Equivalent to "DXT5" in ASCII
GLuint loadDDS(const char * imagepath){
return 0;
unsigned char header[124];
FILE *fp;
// timestampedCout("texture.cpp: Hello!");
/* try to open the file */
fp = fopen(imagepath, "rb");
if (fp == NULL){
timestampedCout("texture.cpp: " << imagepath << " could not be opened. Are you in the right directory?");
return 0;
}
/* verify the type of file */
char filecode[4];
fread(filecode, 1, 4, fp);
if (strncmp(filecode, "DDS ", 4) != 0) {
fclose(fp);
return 0;
}
/* get the surface desc */
fread(&header, 124, 1, fp);
unsigned int height = *(unsigned int*)&(header[8 ]);
unsigned int width = *(unsigned int*)&(header[12]);
unsigned int linearSize = *(unsigned int*)&(header[16]);
unsigned int mipMapCount = *(unsigned int*)&(header[24]);
unsigned int fourCC = *(unsigned int*)&(header[80]);
unsigned char * buffer;
unsigned int bufsize;
/* how big is it going to be including all mipmaps? */
bufsize = mipMapCount > 1 ? linearSize * 2 : linearSize;
buffer = (unsigned char*)malloc(bufsize * sizeof(unsigned char));
fread(buffer, 1, bufsize, fp);
/* close the file pointer */
fclose(fp);
unsigned int components = (fourCC == FOURCC_DXT1) ? 3 : 4;
unsigned int format;
switch(fourCC) {
case FOURCC_DXT1:
format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
break;
case FOURCC_DXT3:
format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
break;
case FOURCC_DXT5:
format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
default:
free(buffer);
return 0;
}
// Create one OpenGL texture
GLuint textureID;
glGenTextures(1, &textureID);
// "Bind" the newly created texture : all future texture functions will modify this texture
glBindTexture(GL_TEXTURE_2D, textureID);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
unsigned int blockSize = (format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) ? 8 : 16;
unsigned int offset = 0;
/* load the mipmaps */
for (unsigned int level = 0; level < mipMapCount && (width || height); ++level) {
unsigned int size = ((width + 3) / 4) * ((height + 3) / 4) * blockSize;
glCompressedTexImage2D(GL_TEXTURE_2D, level, format, width, height,
0, size, buffer + offset);
offset += size;
width /= 2;
height /= 2;
// Deal with Non-Power-Of-Two textures. This code is not included in the webpage to reduce clutter.
if (width < 1) width = 1;
if (height < 1) height = 1;
}
free(buffer);
return textureID;
}

11
texture.hpp Normal file
View File

@@ -0,0 +1,11 @@
#include <iostream>
//#include <stdlib.h>
#include "timeh.hpp"
#include <string.h>
#include "GL/glew.h"
// Load a .BMP file using our custom loader
GLuint loadBMP_custom(const char * imagepath);
// Load a .DDS file using GLFW's own loader
GLuint loadDDS(const char * imagepath);

5
timeh.cpp Normal file
View File

@@ -0,0 +1,5 @@
#include "timeh.hpp"
std::time_t getTime() {
return std::time(nullptr);
}

4
timeh.hpp Normal file
View File

@@ -0,0 +1,4 @@
#pragma once
#include <ctime>
std::time_t getTime();
#define timestampedCout(msg) {std::time_t currentTime = getTime(); std::cout << "( " << currentTime << ") " << msg << "\n";}