Experience-Monks/orbit-controls

Re-jig the math

Opened this issue · 4 comments

This is using EffectControls as a reference for the orbit math. It might be better to re-write that part with quaternion rotations and more accurate terminology. (I could be wrong but it seems like ThreeJS mixed up phi and theta? Hmm)

It seems that spherical coordinates would be the correct choice over quaternions in this case, as there are 2 clear axes of rotation, and quaternions could lead to incorrect tilting. As for phi vs theta, it looks like it's convention according to the wiki page on spherical coordinates. This implementation appears to be using the mathematics convention vs the physics one. Although our axes are in different locations in space as compared to those examples.

I think it would be easier to kill it pitch and yaw as opposed the Greek letters. I know I'll never remember the difference, plus there appears to be ambiguity there anyway, while pitch and yaw is a fairly set thing.

I think you are right that pitch/yaw is a bit more set in stone. Just so we are clear – this is what we would use.

I am not strongly tied to either phi/theta or pitch/yaw. Honestly I can never remember any of them, so every time I end up just changing the value to see which axis it affects. 😂

Also I think you're right, another controller like arcball-controls would be a better fit for quaternions. At that point we could probably share/modularize some common parts.

I can mostly keep pitch and yaw correct in my head from playing flight simulators :) That video is what I was thinking for it.

👍 for the arcball-controls