I have developed a simple three.js
application that renders a cube, and which have several buttons to set fixed camera positions.
The function associated with each button sets the camera position and orientation by doing camera.position.set(vector)
, and camera.lookAt(center_of_bounding_box)
. camera
is a OrthographicCamera
of three.js
, and vector
and center_of_bounding_box
are both instances of the three.js
class Vector3
.
When I pan the cube, and set a fixed view, it is rendered correctly. However, when I pan it again, the application moves it, like if the controls had some kind of offset.
I am very new to three.js
, and I could not resolve this problem searching on the web, because the given solutions seem to me that solve another issues. Should I do something in the OrbitControls
when I set the camera position and orientation manually? Any help to face this issue will be appreciated, thanks.