From 31f259b4b5279d5a1eb65d9a88be8db2e0c5e696 Mon Sep 17 00:00:00 2001 From: any Date: Sun, 19 Jul 2026 21:25:38 +0200 Subject: [PATCH] structs erstellt --- CMakeLists.txt | 5 ++++- main.c | 1 + structs.h | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 structs.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b2d129..767d858 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,4 +7,7 @@ add_executable(Raytracer main.c examples.c examples.h cJSON.c - cJSON.h) + cJSON.h + vec3.h + triangle.h + structs.h) diff --git a/main.c b/main.c index 4497ddb..480c556 100644 --- a/main.c +++ b/main.c @@ -9,6 +9,7 @@ #include "cJSON.h" #include #define MAXJSONSIZE (100 * 1024) +#include "structs.h" int main() { int width = 1280; int height = 780; diff --git a/structs.h b/structs.h new file mode 100644 index 0000000..22cc113 --- /dev/null +++ b/structs.h @@ -0,0 +1,9 @@ +struct vec3 { + float x, y, z; +}; +typedef struct vec3 vec3; + +struct triangle { + vec3 a, b, c; + vec3 normal; +}; typedef struct triangle triangle; \ No newline at end of file