It does work in 3D too: just use the right mouse button to rotate the scene.
Thanks, Its worked for the sample sphere shape. I have tried with obj file in SceneLoader. It’s not working for me.
I have commented the sphere shape and ground line code and added the below lines,
BABYLON.SceneLoader.Append("/assets/", “RAB.obj”, scene, function (meshes) {
scene.createDefaultCameraOrLight(true, true, true);
});
After added this lines, zoom to the cursor it not working. Default zoom only working.
Can you help?
It does work correctly for me with an external asset:
https://playground.babylonjs.com/#EBPQH9#27
You should provide a PG with your own asset if that does not work for you.
I am getting error in this line
scene.activeCamera.alpha += Math.PI; // camera +180°
(error TS2339: Property ‘alpha’ does not exist on type ‘Camera’.)
alpha
only exists for arc rotate cameras: your camera must be a free camera.
OK. I have used same code in the PG (https://playground.babylonjs.com/#EBPQH9#27)
But still, I got the same error.
The error is on totalX:
It seems camera.panningSensibility = 6250 / Math.abs(totalX / 2);
should be inside if (zoomTarget) {
.
Yes, I have changed already. After changes the package.json, its working for me.
But the after certain level of zoom, object is flipped. Is it possible to set the zoom level? so the flip of object can be avoided.
Just don’t call zoom2DView
if the total zoom value is reaching a given value:
Thanks, it’s working as per your reply.