SketchFab Like zooming/ flying capabilty to the annotations

Hi

Can some one help me on the flying capabilty on annotations.

What method/function I should use to achieve this zooming/flying capability on the annotation click.

It should take me to that annotation view when I click on it.

Please suggest the approach.

Thanks

2 Likes

You can achieve a similar effect by animating the camera with GSAP. Check out the following simple demo that demonstrates this approach: https://jsfiddle.net/a6qzkf4b/

The relevant code section is:

 // define focus point
controls.target.set( 0, 0, 0 );

// animate camera position
gsap.to( camera.position, {
	duration: 2,
	x: 0,
	y: 10,
	z: 20,
	onUpdate: function() {
		controls.update();
	}
} );

Meaning you define the new position of the camera and call the update() method of the controls. You also have to set the new focus point of the controls when starting the animation.

3 Likes