diff options
author | Joshua Rowe <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-11 15:42:37 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 15:42:37 +1100 |
commit | 7b9ef1066e49fe3e0c7791e097b26445f0f35f3d (patch) | |
tree | 1b0d3222a8b37e12a8b128861bac6ad380228362 /examples | |
parent | 8019f49a4b0d657f882c148ae6582da78a7d2262 (diff) | |
parent | 25fc6a03a3c78c755e8b00c481c7d71da6e145c4 (diff) |
Merge pull request #6 from omnisci3nce/cel-49-directory-name-function-posix
Support relative path in loaders using a wrapper around dirname()
Diffstat (limited to 'examples')
-rw-r--r-- | examples/obj_loading/ex_obj_loading.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/obj_loading/ex_obj_loading.c b/examples/obj_loading/ex_obj_loading.c index d250857..bdadd7e 100644 --- a/examples/obj_loading/ex_obj_loading.c +++ b/examples/obj_loading/ex_obj_loading.c @@ -13,16 +13,17 @@ int main() { // --- Set up our scene // 1. load model from disk - model_handle cube_handle = model_load_obj(core, "assets/models/obj/cube/cube.obj", true); - model* cube = &core->models->data[cube_handle.raw]; + model_handle backpack_handle = + model_load_obj(core, "assets/models/obj/backpack/backpack.obj", true); + model* backpack = &core->models->data[backpack_handle.raw]; // 2. upload vertex data to gpu - model_upload_meshes(&core->renderer, cube); + model_upload_meshes(&core->renderer, backpack); // 3. create a camera vec3 camera_pos = vec3(3., 4., 10.); vec3 camera_front = vec3_normalise(vec3_negate(camera_pos)); camera cam = camera_create(camera_pos, camera_front, VEC3_Y, deg_to_rad(45.0)); - // Main loop + // --- Enter Main loop while (!glfwWindowShouldClose(core->renderer.window)) { input_update(&core->input); threadpool_process_results(&core->threadpool, 1); @@ -31,8 +32,8 @@ int main() { // Draw the cube transform cube_tf = - transform_create(VEC3_ZERO, quat_ident(), 2.5); // make the cube a bit bigger - draw_model(&core->renderer, &cam, cube, cube_tf); + transform_create(VEC3_ZERO, quat_ident(), 2.0); // make the backpack a bit bigger + draw_model(&core->renderer, &cam, backpack, cube_tf); render_frame_end(&core->renderer); } |