Skip to content

Commit d6adc29

Browse files
committed
fix: glTF camera fov is in radians, not degrees
1 parent d02933d commit d6adc29

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/jsm/loaders/GLTFLoader.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,14 @@ class GLTFAnimationPointerExtension {
12451245

12461246
const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear;
12471247

1248-
const outputArray = getArrayFromAccessor( outputAccessor );
1248+
let outputArray = getArrayFromAccessor( outputAccessor );
1249+
1250+
// convert fov values from radians to degrees
1251+
if ( animationPointerPropertyPath.endsWith( '.fov' ) ) {
1252+
1253+
outputArray = outputArray.map( value => value / Math.PI * 180 );
1254+
1255+
}
12491256

12501257
const track = new TypedKeyframeTrack(
12511258
animationPointerPropertyPath,

0 commit comments

Comments
 (0)