Initial implementatin of barycentric coordinates
This commit is contained in:
@@ -21,19 +21,21 @@ int main(void) {
|
||||
}
|
||||
|
||||
Colour bg = {.r = 42, .g = 45, .b = 52, .a = 255};
|
||||
Colour teal = {.r = 14, .g = 156, .b = 208, .a = 255};
|
||||
Colour orange = {.r = 242, .g = 100, .b = 48, .a = 255};
|
||||
Image img = {.width = 1200, .height = 1200};
|
||||
if (!init_image(arena, &img)) {
|
||||
return TINY_EXIT_IMAGE_INIT_FAILED;
|
||||
}
|
||||
|
||||
Model model = load_obj_file(arena, "resources/head.obj");
|
||||
Model model = load_obj_file(arena, "resources/triangle.obj");
|
||||
if (IS_NULL_MODEL(model)) {
|
||||
return TINY_EXIT_MODEL_LOAD_FAILED;
|
||||
}
|
||||
|
||||
clear_image(&img, bg);
|
||||
render_model(&model, &img, orange, RENDER_TYPE_FILLED);
|
||||
render_model(&model, &img, teal, RENDER_TYPE_FILLED);
|
||||
render_model(&model, &img, orange, RENDER_TYPE_WIREFRAME);
|
||||
save_image(&img, "result.pam");
|
||||
|
||||
wapp_mem_arena_destroy(&arena);
|
||||
|
||||
Reference in New Issue
Block a user