Can someone please tell me how to change the target on an ArcRotateCamera because what I am doing has zero effect.
Here I create a camera pointed at the center of a mesh I have created:
var camera = new BABYLON.ArcRotateCamera(“camera1”, 0, 0.8, 10, new BABYLON.Vector3(0, 4.5, -10), scene);
camera.zoomToMouseLocation = true;
camera.setTarget(new BABYLON.Vector3(0, 4.5, 10));
camera.attachControl(true);
When the mesh changes, defined by variables width, height and length, I want to change the target to the new center of the mesh.
So I do this:
camera.setTarget(new BABYLON.Vector3(0, height/2, length/2));
Nothing changes.
Am I missing something?