I have 1 object on the scene and you want to rotate it about its axis. I am using THREE.TrackballControls. But when my object is not in the center of the screen, the rotation is bad (it rotates relative to the center of the screen). I tried to reposition the camera before creating the controls. But that did not work.
var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000); camera.position.z = 3; camera.position.y = 10; controls = new THREE.TrackballControls( camera );
Can I specify the center of rotation of the camera in TrackballControls? (Thus, the object will not rotate relative to the center of the scene)
Thanks, Zhenya
source share