Currently, I am in the process of creating a spherical globe with predefined locations that are geo-mapped and represented as points. My goal is to highlight these locations by smoothly rotating the globe along its y-axis from one point to another. Despite my attempts with the code below, it seems that it does not work correctly for all locations.
location.geometry.computeBoundingBox();
var position = new THREE.Vector3();
position.subVectors( location.geometry.boundingBox.max, location.geometry.boundingBox.min );
position.multiplyScalar( 0.20 );
position.sub( location.geometry.boundingBox.min );
location.matrixWorld.multiplyVector3( position );
var startingPoint = scene.clone().position;
var endPoint = position;
var distance = startPoint.distanceTo( endPoint );
locationCollection.rotation.y = distance;
I believe there might be something about the concept that I'm missing. I am hopeful that the community can provide some insights or suggestions.