From c447ba1064ec9b170dfbee30d3b49da4cf8e0ffd Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 6 Jan 2023 09:25:11 -0800 Subject: More spec-compliant rendering of albedo and metal-roughness. --- gltfview/src/game.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gltfview') diff --git a/gltfview/src/game.c b/gltfview/src/game.c index 54e498b..224200d 100644 --- a/gltfview/src/game.c +++ b/gltfview/src/game.c @@ -189,8 +189,8 @@ static bool load_texture_debugger_scene(Game* game) { bool game_new(Game* game, int argc, const char** argv) { // TODO: getopt() to implement proper argument parsing. - const char* view_mode = argc > 1 ? argv[1] : ""; - const char* scene_filepath = argc > 2 ? argv[2] : DEFAULT_SCENE_FILE; + const char* scene_filepath = argc > 1 ? argv[1] : DEFAULT_SCENE_FILE; + const char* view_mode = argc > 2 ? argv[2] : ""; game->gfx = gfx_init(); if (!game->gfx) { @@ -234,12 +234,15 @@ void game_update(Game* game, double t, double dt) { usleep(1000); game->elapsed -= 1.0; } - Camera* camera = gfx_get_camera_camera(game->camera); + // TODO: Compute bounding boxes to then find a good orbit point and radius + // for each scene. + const vec3 orbit_point = vec3_make(0, 2, 0); + Camera* camera = gfx_get_camera_camera(game->camera); spatial3_orbit( - &camera->spatial, vec3_make(0, 0, 0), - /*radius=*/2, + &camera->spatial, orbit_point, + /*radius=*/2.5, /*azimuth=*/t * 0.5, /*zenith=*/0); - spatial3_lookat(&camera->spatial, vec3_make(0, 0, 0)); + spatial3_lookat(&camera->spatial, orbit_point); } void game_render(const Game* game) { -- cgit v1.2.3