From f739786d3af26bb9f96212a5e1e6f33ada81d916 Mon Sep 17 00:00:00 2001 From: David McAllister Date: Sun, 27 Nov 2022 20:05:28 -0800 Subject: [PATCH] Pinched Looping Camera Path Fix (#1029) Pinched looping path fix --- .../modules/SidePanel/CameraPanel/curve.js | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/curve.js b/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/curve.js index 11a36f7cf..7715a0df9 100644 --- a/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/curve.js +++ b/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/curve.js @@ -47,30 +47,15 @@ export function get_curve_object_from_cameras( fovs.push(new THREE.Vector3(0, 0, camera.fov)); } - if (is_cycle) { - const camera = cameras[0]; - - const up = new THREE.Vector3(0, 1, 0); - const lookat = new THREE.Vector3(0, 0, 1); - - up.applyQuaternion(camera.quaternion); - lookat.applyQuaternion(camera.quaternion); - - positions.push(camera.position); - ups.push(up); - lookats.push(lookat); - fovs.push(new THREE.Vector3(0, 0, camera.fov)); - } - let curve_positions = null; let curve_lookats = null; let curve_ups = null; let curve_fovs = null; - curve_positions = get_catmull_rom_curve(positions, false, smoothness_value); - curve_lookats = get_catmull_rom_curve(lookats, false, smoothness_value); - curve_ups = get_catmull_rom_curve(ups, false, smoothness_value); - curve_fovs = get_catmull_rom_curve(fovs, false, 0.05); + curve_positions = get_catmull_rom_curve(positions, is_cycle, smoothness_value); + curve_lookats = get_catmull_rom_curve(lookats, is_cycle, smoothness_value); + curve_ups = get_catmull_rom_curve(ups, is_cycle, smoothness_value); + curve_fovs = get_catmull_rom_curve(fovs, is_cycle, smoothness_value / 10); const curve_object = { curve_positions,