From 6f690666ccd0ec482efee402692910ae0ae31321 Mon Sep 17 00:00:00 2001 From: Felix Herbst Date: Tue, 5 Jul 2022 15:27:46 +0200 Subject: [PATCH] fix: glTF camera fov is in radians, not degrees --- examples/jsm/loaders/GLTFLoader.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index c7f9a437e44bb7..ff348761902e8d 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -1245,7 +1245,14 @@ class GLTFAnimationPointerExtension { const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear; - const outputArray = getArrayFromAccessor( outputAccessor ); + let outputArray = getArrayFromAccessor( outputAccessor ); + + // convert fov values from radians to degrees + if ( animationPointerPropertyPath.endsWith( '.fov' ) ) { + + outputArray = outputArray.map( value => value * Math.PI / 180 ); + + } const track = new TypedKeyframeTrack( animationPointerPropertyPath,