pinshegitfeo
This commit is contained in:
1 parent
252aab3dd2
commit
29ab40e33d
9 files changed
+73
No files matched your search
Binary file not shown.
@@ -1,3 +1,5 @@
|
||||
#include <cglm/cglm.h>
|
||||
|
||||
#define A -1,-1,-1,
|
||||
#define B -1,-1, 1,
|
||||
#define C -1, 1,-1,
|
||||
@@ -7,6 +9,20 @@
|
||||
#define G 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 =
|
||||
{
|
||||
3*3*2*6,
|
||||
@@ -30,3 +46,32 @@ narray_float_t d_cube =
|
||||
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
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user