adding in the axes for all the camera poses. failing to read the file properly though

This commit is contained in:
2025-08-21 23:54:05 -05:00
parent 8b816f8296
commit 19f786ee7c
10 changed files with 177 additions and 69 deletions

View File

@@ -11,8 +11,8 @@ enum class ParserState {
FACE_SKIP,
};
bool load_body(body* out_body, const char* obj_filepath) {
array<char> source;
bool load_body(Body* out_body, const char* obj_filepath) {
Array<char> source;
if (!read_file(&source, obj_filepath)) {
return false;
}
@@ -27,8 +27,8 @@ bool load_body(body* out_body, const char* obj_filepath) {
}
}
array<float> verts = { (float*)malloc(sizeof(float) * num_verts * 3), num_verts * 3 };
array<int> faces = { (int*)malloc(sizeof(int) * num_faces * 3), num_faces*3 };
Array<float> verts = { (float*)malloc(sizeof(float) * num_verts * 3), num_verts * 3 };
Array<int> faces = { (int*)malloc(sizeof(int) * num_faces * 3), num_faces*3 };
// Get ready for the parsing loop
ParserState state = ParserState::PREFIX;
@@ -114,9 +114,9 @@ bool load_body(body* out_body, const char* obj_filepath) {
return true;
}
void draw_body(const body& b) {
void draw_body(const Body& b) {
use_shader(b.shader);
set_uniform(b.shader, "global_t", b.pose);
set_uniform(b.shader, "global_t", b.scale*b.pose);
set_uniform(b.shader, "color", b.color);
glBindVertexArray(b.vao);
glDrawElements(GL_TRIANGLES, b.faces.len, GL_UNSIGNED_INT, 0);