3D object rotates in opposite direction

I think this is the continuation of this thread (iirc the codepen there didn’t work) ?

As in the previous thread - if you work with axis angles and rotateOnAxis for calculations, you’re limiting yourself to first and second quadrants of the polar coordinates. Beyond a certain threshold, angleTo will flip the angle to a mirrored value.

Maybe this example can clarify the issue a bit better in a visual way - the green arrow is using getWorldDirection (ie. matrix / quaternion transform) for calculations, while the blue arrow is using rotateOnAxis and angleTo for calculations. Note what happens to the blue line when angle goes beyond Q1.


To help a bit more in a practical way - could you update your codepen to show the rotation? Right now it seems static, and it’s not clear where the rotation could be enabled and tested.

1 Like