Skip to content

Commit

Permalink
fix: glTF camera fov is in radians, not degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Jul 5, 2022
1 parent d02933d commit 6f69066
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6f69066

Please sign in to comment.