Hi,
I have OrbitControls that rotates around an object with four sides. I want to modify the rotate speed such that this is the case:
If I drag mouse 25% across screen, rotate the camera around the object 90 degrees.
If I drag mouse the next 25% across screen, rotate the camera the next 90 degrees.
If I drag mouse 25% farther, rotate the camera 90 degrees again.
Do so until it completes rotation.
Then, I sometimes have an object with five sides. In such a case, I want to modify the rotate speed such that this is the case:
If I drag mouse 20% across screen, rotate the camera 72 degrees.
etc.
basically the length I have to drag to rotate is dependent on the number of sides of the object, such that a complete rotation is always possible by dragging across the screen.
I would also like to restrict the rotation so that it is always facing a complete side of the object. ie - if I have an object with four sides, I only want to allow the camera angles of 90-180-270-360 and nothing in between.
I believe I could modify OrbitControls EPS and restrict the phi limit, but perhaps there is a better approach. Does anyone have a general architectural approach or example they could point me to? Maybe I should just abandon OrbitControls? I cant find anything.
Thank you