Author SHA1 Message Date
Legaeli 40b052bcef gittest1234 2025-11-17 15:39:00 +01:00
Legaeli 92cd831b05 gitidea 2025-11-17 15:37:40 +01:00
Legaeli 362603fa9b gitignore 2025-11-17 15:29:22 +01:00
Legaeli f7f3eea9e3 Merge branch 'project_developer' of https://git.efi.th-nuernberg.de/gitea/guballaro99746/Stone_Development into project_developer 2025-11-17 15:20:55 +01:00
Legaeli 5e11d812c6 Backup5678 2025-11-17 15:20:10 +01:00
Legaeli c954f2f2df Backup1234 2025-11-17 15:14:17 +01:00
Legaeli 7eedd59f6f Bugs fixed. Funktioniert wie geplant. Ich erwarte eine Gehalsterhöhung Chef 2025-11-04 08:33:08 +01:00
Legaeli 3c5d04cbe3 Projekt kompiliert noch nicht, wahrscheinlich pathing Fehler. Alle Funktionen implementiert. 2025-11-03 17:14:01 +01:00
Niklumm 1bdcedb100 update test 2025-11-03 15:09:05 +01:00
Niklumm 8b720d8b5b Update design.txt 2025-11-03 14:48:40 +01:00
Niklumm 558c9160f6 Merge branch 'main' into architect 2025-11-03 14:43:04 +01:00
guballaro99746 6855f5fd28 Requirements 2025-11-03 14:40:16 +01:00
Niklumm 0579b6054c Create design.txt 2025-11-03 14:30:38 +01:00
Niklumm 3b1a499293 branch commit? 2025-11-03 14:27:20 +01:00
guballaro99746 e2c87dddb9 Merge branch 'main' of https://git.efi.th-nuernberg.de/gitea/guballaro99746/Stone_Development 2025-11-03 14:23:37 +01:00
guballaro99746 ffc126599c Update 2025-11-03 14:21:48 +01:00
Niklumm 9338f2511b Update motivation.txt 2025-10-21 15:51:00 +02:00
guballa 4559cb3892 Update motivation.txt 2025-10-21 15:48:02 +02:00
Niklumm 164ef61900 Update update 2025-10-21 15:40:33 +02:00
guballaro99746 b6b1bd63a9 SEHR WICHTIG git add motivation.txt! 2025-10-21 09:03:10 +02:00
guballaro99746 5c94d3dcff Hallo ROBEROTÈOR 2025-10-21 08:37:06 +02:00
guballaro99746 c08842ce86 Hallo MEINE NAME IST ROBERTO 2025-10-21 08:35:45 +02:00
Niklumm ecfef40f72 Merge branch 'main' of https://git.efi.th-nuernberg.de/gitea/guballaro99746/Stone_Development 2025-10-20 15:27:56 +02:00
Axiom d1ff980345 TEST 2025-10-20 15:27:19 +02:00
Niklumm 108102f03f GitHub desktop
test commit
2025-10-20 15:26:43 +02:00
9 changed files with 300 additions and 31 deletions
+3
View File
@@ -0,0 +1,3 @@
cmake-build-debug-mingw/
cmake-build-debug/
.idea/
+47 -16
View File
@@ -1,39 +1,70 @@
cmake_minimum_required(VERSION 3.28)
cmake_minimum_required(VERSION 3.16)
project(Prog3B)
# === Basis-Konfiguration ===
set(EXECUTABLE_NAME Prog3B)
set(OS_NAME windows)
# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Set the default build type if not specified
# Default-Build-Type (falls nicht angegeben)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
# === Quell- und Header-Dateien ===
set(SRC_FILES
${CMAKE_CURRENT_LIST_DIR}/main.cpp
${CMAKE_CURRENT_LIST_DIR}/gamecube.cpp
${CMAKE_CURRENT_LIST_DIR}/gamematrix.cpp
)
set(INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}/OS_NAME
${CMAKE_CURRENT_LIST_DIR}/windows
${CMAKE_CURRENT_LIST_DIR}/raylib
)
# === Betriebssystem automatisch erkennen ===
if(WIN32)
set(OS_DIR "windows")
elseif(APPLE)
# Prüfen, ob ARM oder x86
execute_process(
COMMAND uname -m
OUTPUT_VARIABLE ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(ARCH STREQUAL "arm64")
set(OS_DIR "mac_arm")
else()
set(OS_DIR "mac_x86")
endif()
elseif(UNIX)
set(OS_DIR "linux")
else()
message(FATAL_ERROR "Unbekanntes Betriebssystem!")
endif()
# === Executable erstellen ===
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS})
# === Bibliotheken verlinken ===
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/${OS_NAME}/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/${OS_NAME}/libraylib.a
${CMAKE_CURRENT_LIST_DIR}/${OS_DIR}/libraylib.a
)
if (WIN32)
target_link_libraries(Prog3B PRIVATE winmm)
# Windows: zusätzliche Systemlib
if(WIN32)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE winmm)
endif()
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
if (APPLE)
target_link_libraries(Prog3B "-framework IOKit")
target_link_libraries(Prog3B "-framework Cocoa")
target_link_libraries(Prog3B "-framework OpenGL")
# macOS: Frameworks
if(APPLE)
target_link_libraries(${EXECUTABLE_NAME}
"-framework IOKit"
"-framework Cocoa"
"-framework OpenGL"
)
endif()
+75
View File
@@ -0,0 +1,75 @@
========================================================
Projekt: gamematrix (C++ Library)
Rolle: Architekt
Datei: design.txt
Datum: 03.11
Team: Stone_Development
========================================================
# ----------------------------
# 1. Projektstruktur / Namespace
# ----------------------------
Namespace: Matrix3D
Ziel: Saubere Trennung der Bibliothek, Vermeidung von Namenskonflikten.
Beispiel:
namespace Matrix3D {
// Funktionen, ggf Klasse(n)
}
# ----------------------------
# 2. Datenstrukturen / Klassen
# ----------------------------
Listen Sie die Klassen oder Structs auf, die verwendet werden:
| Name | Typ | Beschreibung |
|--------|------------------------------------------|--------------|
| Vec3 | struct Vec3 | 3D-Vektor (x, y, z) |
| Mat4 | std::array<std::array<double,4>,4> | 4x4-Matrix (homogen) |
| ______ | ________ | ___________________ |
| ______ | ________ | ___________________ |
# ----------------------------
# 3. Operatoren / Templates
# ----------------------------
Welche Operatoren oder Templates sollen definiert werden?
- Templates für unterschiedliche Datentypen? x Ja
- Operatoren:
- Mat4 * Mat4
- Mat4 * Vec3
# ----------------------------
# 4. Funktionen / Schnittstellen
# ----------------------------
Liste der Funktionen mit Eingabe/Ausgabe und kurzer Beschreibung:
| Funktion | Eingabe | Ausgabe | Kurzbeschreibung |
|---------------|------------------------------------|-----------------------|----------------------------------------|
| matmul | Mat4 A, Mat4 B | Mat4 | Matrixmultiplikation 4x4 |
| translate | Vec3 pos | Mat4 | Verschiebungstransformation |
| rot3D | double angle_deg, char axis | Mat4 | Rotation um Achse x/y/z | |
| _____________ | __________________________________ | ____________________ | ______________________________ |
# ----------------------------
# 5. Designentscheidungen / Hinweise
# ----------------------------
- Rückgabe der Matrizen per Wert oder Referenz? Rückgabe
- Verwendung von std::array oder std::vector? std::array
- Homogene Koordinaten für Translation / Rotation (4x4)? ☐ Ja
- Weitere Designüberlegungen: ___________________________
# ----------------------------
# 6. Deliverables / Milestones
# ----------------------------
- design.txt fertig und im Branch architect committed
- Übergabe an Entwickler für Implementierung
========================================================
Hinweis:
- Dieses Dokument dient als Grundlage für die Implementierung.
- Alle Designentscheidungen sollen klar nachvollziehbar sein.
========================================================
test
+4 -3
View File
@@ -7,6 +7,7 @@ gamecube::gamecube(const Vec3 &pos, Color col)
// hallo hier ist robert
//hallo Robert hier ist Niklas
//test
// Ich bin ein Roberter
void gamecube::Update(float flipSpeed)
{
if (flippingForward)
@@ -43,11 +44,11 @@ void gamecube::Draw() const
rlPushMatrix();
// Matrizen für Rotation und Translation erzeugen
auto matrix_a = gameMatrix::translate({ position.x, position.y, position.z});
auto matrix_b = gameMatrix::rot3D(rotation, 'y');
auto matrix_a = Matrix3D::gameMatrix::translate({ position.x, position.y, position.z});
auto matrix_b = Matrix3D::gameMatrix::rot3D(rotation, 'y');
// Matrizen multiplizieren (Translation * Rotation)
auto model = gameMatrix::matmul(matrix_a, matrix_b);
auto model = Matrix3D::gameMatrix::matmul(matrix_a, matrix_b);
// transform for raylib matrix
float f[16];
+87
View File
@@ -0,0 +1,87 @@
#include "gamematrix.h"
using namespace Matrix3D;
///
/// @param matrix1 - First matrix
/// @param matrix2 - Second matrix
/// @return Returns the multiplication of matrix 1 and matrix 2.
std::array<std::array<double,4>,4> gameMatrix::matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2) {
std::array<std::array<double,4>,4> matrix3 = {};
if (matrix1[0].size() != matrix2.size()) {
throw std::invalid_argument("Number of columns of matrix 1 must be equal to number of rows of matrix 2");
};
for (int i = 0; i < matrix1.size(); i++) {
std::array<double,4> temp_array = {};
for (int j = 0; j < matrix2[i].size(); j++) {
double temp = 0;
for (int k = 0; k < matrix2.size(); k++) {
temp += matrix1[i][k] * matrix2[k][j];
}
temp_array[j] = temp;
}
matrix3[i] = temp_array;
}
return matrix3;
}
///
/// @param angle_deg Rotation angle
/// @param axis Rotation axis (x, y, z)
/// @return Returns a rotation matrix based on a given angle and axis.
std::array<std::array<double,4>,4> gameMatrix::rot3D(double angle_deg, char axis) {
if (axis != 'x' && axis != 'y' && axis != 'z') {
throw std::invalid_argument("Invalid axis");
};
const auto angle_rad = angle_deg * M_PI / 180;
std::array<std::array<double,4>,4> rotationMatrix = {};
switch (axis) {
case 'x': {
std::array<std::array<double,4>,4> rMx = {{
{1, 0, 0, 0},
{0, cos(angle_rad), -sin(angle_rad), 0},
{0, sin(angle_rad), cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMx;
}
break;
case 'y': {
std::array<std::array<double,4>,4> rMy = {{
{cos(angle_rad), 0, sin(angle_rad), 0},
{0, 1, 0, 0},
{-sin(angle_rad), 0, cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMy;
}
break;
case 'z': {
std::array<std::array<double,4>,4> rMz = {{
{cos(angle_rad), -sin(angle_rad), 0, 0},
{sin(angle_rad), cos(angle_rad), 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMz;
}
break;
}
return rotationMatrix;
};
///
/// @param pos 3 point vector (x, y, z)
/// @return Returns a 4x4 translation matrix base on a given vector.
std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double, 3>& pos) {
std::array<std::array<double,4>,4> transMatrix = {{{1, 0, 0, pos[0]}, {0, 1, 0, pos[1]}, {0, 0, 1, pos[2]}, {0, 0, 0, 1}}};
return transMatrix;
};
+13 -6
View File
@@ -4,16 +4,23 @@
#include <stdexcept>
#include <cmath>
class gameMatrix
{
public:
namespace Matrix3D {
class gameMatrix
{
public:
// Matrix Multiplikation
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& A,
const std::array<std::array<double,4>,4>& B);
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2);
// Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
// Verschiebung
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
};
private:
//TODO: Was für eine Rolle spielen Vec3 und Mat4???
struct Vec3 {double x,y,z;};
std::array<std::array<double,4>,4> Mat4 {};
};
}
+1 -1
View File
@@ -8,9 +8,9 @@
int main()
{
//CHRIS WAR HIER
//AXIOM WAR HIER
// Zufall initialisieren
srand(time(NULL));
// Fenster und Kamera
InitWindow(800, 600, "3D Memory Game with Matrix3D Library");
SetTargetFPS(60);
+1
View File
@@ -0,0 +1 @@
Hallo ehrwürdige Teamkameraden, wir werden das Projekt mit Bravur meistern! //lern deutsch //Wovon redest du hä? ist doch alles astrein... //du Schlingel
+64
View File
@@ -0,0 +1,64 @@
========================================================
Projekt: gamematrix (C++ Library)
Rolle: Projektleiter
Datei: requirements.txt
Datum: 03.11.2025
Team: Stone_Development
========================================================
# ----------------------------
# 1. Projektziel
# ----------------------------
Beschreiben Sie hier kurz das Ziel des Projekts:
Ziel: gamematrix.cpp erweitern, Matrizenoperationen für 3D-Transformationen bereitstellen,
Integration in das bestehende Spielprojekt, Vorgehensmodell: Wasserfall
# ----------------------------
# 2. Funktionale Anforderungen
# ----------------------------
Listen Sie alle Funktionen auf, die die Bibliothek bereitstellen soll.
Tragen Sie ein: Funktion, Eingabe, Ausgabe, kurze Beschreibung
| Funktion | Eingabe, Kurzbeschreibung | Ausgabe | |
|---------------|------------------------------------|-----------------------|----------------------------------------|
| matmul | 4x4 Matrix A, 4x4 Matrix B | 4x4 Matrix | _____________________________________ |
| translate | 3D Vektor | 4x4 Matrix | _____________________________________ |
| rot3D | Winkel in °, Rotationsachse (x/y/z)| 4x4 Matrix | _____________________________________ |
| _____________ | __________________________________ | ____________________ | ______________________________ |
| _____________ | __________________________________ | ____________________ | ______________________________ |
# ----------------------------
# 3. Nicht-funktionale Anforderungen
# ----------------------------
- Lesbarkeit
- Performance
- Wartbarkeit
- Python-Kompatibilität via pybind11
# ----------------------------
# 4. Annahmen / Einschränkungen
# ----------------------------
(z. B. alle Matrizen sind 4x4, Winkel in Grad, nur double)
- Alle Matrizen sind 4x4
- Winkel in Grad
- nur double
# ----------------------------
# 5. Abnahmekriterien
# ----------------------------
Wie soll geprüft werden, dass die Anforderungen erfüllt sind?
(z. B. Unit-Tests, Beispielrotationen, Matrizenmultiplikation)
- Unit-Tests
- Beispielrotationen
- Matrizenmultiplikation
========================================================
Hinweis:
- Diese Datei wird vom Projektleiter erstellt und gepflegt.
- Jede Phase des Projekts soll hier dokumentiert werden.
========================================================