Hi every one,
I’m working on a stelar system map, for an upcoming Game
but I have some trouble
here is my prototype map : https://global-chaos.fr/game/map
when you click on a planet (the greens hexasphere), the Orbitcontrol target is change for the planet,
but I would like to get the camera position change to follow the object, by reading this https://stackoverflow.com/questions/24855708/how-can-i-apply-trackballcontrols-to-a-moving-target
I have added a function to orbit control to follow the target :
this.goTo = function( vector ) {
panOffset.add(vector.clone().sub(this.target));
scope.object.position.add(vector.clone().sub(scope.object.position).normalize());
}
but I’m doing something wrong with camera calculation, the function is keeping the camera zooming on the Target (the planet), and not allowing me to use the Orbitcontrol
I would like that the camera follow the target, without zooming constantly on it, and following it’s rotation