After creating a basic three.js
application that displays a cube and includes buttons to set fixed camera positions, I encountered some unexpected behavior. You can view a demo of my code here: https://jsfiddle.net/ph0ropg7/9/
In my application, I have implemented the ability to switch to a top view using the TOP VIEW button, and to adjust the cube to fit the screen with the SHOW ALL button. However, I have observed three peculiar issues:
After panning and rotating the cube, pressing the SHOW ALL button results in a change in camera orientation when the cube adjusts to the screen size.
When switching to the top view using the dedicated button, it seems like the controls become unresponsive or locked.
If I select the top view by clicking the TOP VIEW button, and then drag before releasing the left mouse button, the controls behave erratically, causing the objects to vibrate in a strange and bothersome manner.
As a newcomer to three.js
, I am struggling to understand why these issues are occurring. Any advice or suggestions on how to address these problems would be greatly appreciated. Thank you.