My goal is to implement two different control modes in my project: a free "flying" mode and an object-centered (trackball) mode. I want to seamlessly switch between them with the press of a button.
Initially, I experimented with TrackBallControls and FlyControls. The issue I encountered was that TrackballControls relies on Euler angles, while FlyControls is based on Quaternions. In an attempt to make them compatible, I tried converting the camera's rotation vector to a quaternion using:
quaternion.setFromEuler( target ); //where 'target' is a Vector3 containing degrees
Although this approach seemed promising at first, problems arose when rotating the camera slightly and switching controls. This led to incorrect results, and extracting Euler angles from the quaternion (setEulerFromQuaternion) also yielded inaccurate data.
While I could successfully toggle between the two control modes, I struggled to synchronize their rotation coordinates. Upon switching, the camera's position would be correct but its rotation would be off.
Further testing revealed some success with FirstPersonControls, which also use Euler angles. However, the method it uses for screen latitude and longitude calculation proved error-prone and failed completely when there was Z-axis rotation involved.