Camera OrbitControls back to position on mouse release

Hello everyone,

I’m using THREE.OrbitControls to control my camera, a control.target.set to a position and several properties along with it.

I would like my camera to smoothly get back to its initial position on mouseup/touchend. Any suggestion please? That’d be great.

Sounds like you want to use an animation library like GSAP in order to animate between the current and initial state of your camera. There are few existing topics about using GSAP in combination with OrbitControls. The following fiddle shows how camera and controls properties can be animated with GSAP. You can use this as a basis for your own animations.

https://jsfiddle.net/rsf3h9yo/1/

1 Like

Thank you Mugen, a second time for making me discover about this library :+1:t2: I made it work for my camera.position and .rotation, althought it makes the camera flying to the initial pos./rot. rather than '“dollying” back to it.

It might do the trick in my case though :slightly_smiling_face: