Fix barycentric coordinates calculation #2

Merged
abdelrahman merged 8 commits from debug-barycentric into main 2024-08-26 17:12:45 +00:00
2 changed files with 9 additions and 9 deletions
Showing only changes of commit d0b293ec9a - Show all commits

View File

@ -34,9 +34,9 @@ int main(void) {
Model obj = load_obj_file(arena, RESOURCE("head.obj"), RESOURCE("head.pnm"), Model obj = load_obj_file(arena, RESOURCE("head.obj"), RESOURCE("head.pnm"),
RESOURCE("head_nm.pnm")); RESOURCE("head_nm.pnm"));
/* Model obj = */ // Model obj =
/* load_obj_file(arena, RESOURCE("polygon.obj"), RESOURCE("grid.pnm"), // load_obj_file(arena, RESOURCE("polygon.obj"), RESOURCE("grid.pnm"),
* NULL); */ // NULL);
if (IS_INVALID_MODEL(obj)) { if (IS_INVALID_MODEL(obj)) {
return TINY_EXIT_MODEL_LOAD_FAILED; return TINY_EXIT_MODEL_LOAD_FAILED;
} }
@ -45,9 +45,9 @@ int main(void) {
.ambient = 0.3f, .ambient = 0.3f,
.diffuse = 1.5f, .diffuse = 1.5f,
.specular = 2.0f, .specular = 2.0f,
/* .ambient = 0.0f, */ // .ambient = 0.0f,
/* .diffuse = 0.0f, */ // .diffuse = 0.0f,
/* .specular = 2.0f, */ // .specular = 2.0f,
.shininess = 1.5f, .shininess = 1.5f,
}; };
obj.material = material; obj.material = material;

View File

@ -51,9 +51,9 @@ void load_shaders(void) {
get_projection_matrix(PROJECTION_TYPE_ORTHOGRAPHIC); get_projection_matrix(PROJECTION_TYPE_ORTHOGRAPHIC);
M4x4f perspective_projection = M4x4f perspective_projection =
get_projection_matrix(PROJECTION_TYPE_PERSPECTIVE); get_projection_matrix(PROJECTION_TYPE_PERSPECTIVE);
/* M4x4f model_view = mat4x4_identity; */ // M4x4f model_view = mat4x4_identity;
/* M4x4f orthographic_projection = mat4x4_identity; */ // M4x4f orthographic_projection = mat4x4_identity;
/* M4x4f perspective_projection = mat4x4_identity; */ // M4x4f perspective_projection = mat4x4_identity;
perspective.model_view = orthographic.model_view = model_view; perspective.model_view = orthographic.model_view = model_view;
perspective.projection = perspective_projection; perspective.projection = perspective_projection;