47 lines
1.0 KiB
C
47 lines
1.0 KiB
C
#ifndef MESH_H
|
|
#define MESH_H
|
|
|
|
#include "vector.h"
|
|
#include "triangle.h"
|
|
|
|
#define N_CUBE_VERTICES 8
|
|
#define N_CUBE_FACES (6 * 2) // 6 cube faces, 2 triangles per face
|
|
|
|
#define MAX_LEN 256
|
|
|
|
extern vec3_t cube_vertices[N_CUBE_VERTICES];
|
|
extern face_t cube_faces[N_CUBE_FACES];
|
|
|
|
typedef enum {
|
|
COLOR_PURPLE = 0xFF6A2EFF,
|
|
COLOR_SAND_YELLOW = 0xFFE9C46A,
|
|
COLOR_TEAL_GREEN = 0xFF2A9D8F,
|
|
COLOR_ORANGE = 0xFFF4A261,
|
|
COLOR_DARK_BLUE_GREY = 0xFF264653,
|
|
COLOR_MAUVE = 0xFFB5838D,
|
|
COLOR_RED = 0xFFD7263D,
|
|
COLOR_TURQUOISE = 0xFF38A3A5,
|
|
COLOR_GREY = 0xFF757575,
|
|
COLOR_LIGHT_GREEN_BLUE = 0xFF70C1B3,
|
|
COLOR_YELLOW = 0xFFFFC300,
|
|
COLOR_DEEP_PURPLE = 0xFF5D2E8C
|
|
} color_enum_t;
|
|
|
|
typedef struct mesh_t mesh_t;
|
|
struct mesh_t {
|
|
vec3_t* vertices;
|
|
face_t* faces;
|
|
vec3_t rotation;
|
|
vec3_t scale;
|
|
vec3_t translation;
|
|
};
|
|
|
|
extern mesh_t mesh;
|
|
|
|
void parse_face(const char* buffer, face_t* face);
|
|
|
|
void load_cube_mesh_data(void);
|
|
void load_file(const char* filename);
|
|
|
|
#endif
|