pinshegitfeo

This commit is contained in:
Your Name committed 2024-10-16 23:41:32 -06:00
1 parent 252aab3dd2
commit 29ab40e33d
9 files changed
+73

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
BIN
View File
Binary file not shown.
+45
View File
@@ -1,3 +1,5 @@
#include <cglm/cglm.h>
#define A -1,-1,-1, #define A -1,-1,-1,
#define B -1,-1, 1, #define B -1,-1, 1,
#define C -1, 1,-1, #define C -1, 1,-1,
@@ -7,6 +9,20 @@
#define G 1, 1,-1, #define G 1, 1,-1,
#define H 1, 1, 1, #define H 1, 1, 1,
vec3 calc_normal(vec3 v1, vec3 v2, vec3 v3)
{
vec3 lado1, lado2, normal;
glm_vec3_sub(v2, v1, lado1);
glm_vec3_sub(v3, v1, lado2);
glm_vec3_cross(lado1, lado2, normal);
glm_vec3_normalize(normal);
return normal;
}
narray_float_t d_cube = narray_float_t d_cube =
{ {
3*3*2*6, 3*3*2*6,
@@ -30,3 +46,32 @@ narray_float_t d_cube =
B E F B E F
}; };
narray_float_t n_cube = {
3 * 3 * 2 * 6,
calc_normal(A, C, E),
calc_normal(A, C, E),
calc_normal(A, C, E),
calc_normal(E, G, F),
calc_normal(E, G, F),
calc_normal(E, G, F),
calc_normal(A, B, F),
calc_normal(A, B, F),
calc_normal(A, B, F),
calc_normal(C, D, G),
calc_normal(C, D, G),
calc_normal(C, D, G),
calc_normal(D, H, G),
calc_normal(D, H, G),
calc_normal(D, H, G),
calc_normal(A, B, E),
calc_normal(A, B, E),
calc_normal(A, B, E),
};
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.