Fix camera interpolation bug (#858)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-10-30 19:52:24 -07:00
1 parent a32b2d5391
commit 724ec17d75
1 file changed
+3
@@ -60,6 +60,9 @@ export function get_curve_object_from_cameras(
export function get_transform_matrix(position, lookat, up) {
// normalize the vectors
lookat.normalize();
// make up orthogonal to lookat
const up_proj = lookat.clone().multiplyScalar(up.dot(lookat));
up.sub(up_proj);
up.normalize();
// create a copy of the vector up