KhronosGroup / glTF-Sample-Viewer

Physically-Based Rendering in glTF 2.0 using WebGL
Apache License 2.0
1.29k stars 238 forks source link

BoxAnimation sample in glTF assets is shown wrong #512

Closed ToolTech closed 10 months ago

ToolTech commented 1 year ago

have had a discussion in the sample repository about the sample BoxAnimation. It should be a rotation counter clockwise as shown in their gif animation but the glTF smaple viewer renders the animated quat wrong.

The first quat is (0,0,0,-1) wich is a 360 degree rotated object. You might say that this is a unit transform but the argument is 180 degrees of the quat.

The second quat is (1,0,0,0) wich is a 180 degrees rotated object. The quat has argument 90 degrees.

A slerp between these quats will be a counter clockwise rotation around x axis from 360 degrees to 180 degrees.

BUT the sample viewer shows a clockwise rotation ?

jim-ec commented 11 months ago

According to the spec, the viewer does a counter-clockwise rotation around the X-axis (using a right-handed coordinate system).

Also, all the following viewers perform the exact same animation:

So the current behavior should be correct.