Skip to content

Commit

Permalink
Fixing rotation defect in VRMLLoader.js (#28162)
Browse files Browse the repository at this point in the history
VRML files can contain non-normalized rotation vectors, whether correctly or incorrectly.  This change loads such files safely, and has no impact if the vector is already normalized.
  • Loading branch information
vorth committed Apr 19, 2024
1 parent b8b67f2 commit 7ce0c40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/jsm/loaders/VRMLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class VRMLLoader extends Loader {
break;

case 'rotation':
const axis = new Vector3( fieldValues[ 0 ], fieldValues[ 1 ], fieldValues[ 2 ] );
const axis = new Vector3( fieldValues[ 0 ], fieldValues[ 1 ], fieldValues[ 2 ] ).normalize();
const angle = fieldValues[ 3 ];
object.quaternion.setFromAxisAngle( axis, angle );
break;
Expand Down

0 comments on commit 7ce0c40

Please sign in to comment.