Reputation: 425
In three.js How to set the center of the camera orbit ? (with OrbitControls)
Egg : I want to use
camera.lookAt(new THREE.Vector3( 100,50,200 )
and make my camera orbit around this point and not around 0,0,0
How to set ?
Upvotes: 11
Views: 11049
Reputation: 104783
You can set the center of rotation for OrbitControls
like so:
const controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.target.set( x, y, z );
The Vector3
target
is the center of rotation, and the point the camera "looks at".
three.js r.76
Upvotes: 23