Different types of camera controls

When using the camera, I have a few problems, do not understand, is not only ArcRotateCamera, to him, the mouse control, and control the mouse closer to pull away, and the general camera or their own camera and don’t have the function, I have been using their own camera, now I want to give him the mouse wheel control distance, only the left mouse button for selected, but the buttons seem to be friendly to it does not, this is my test code

let camera = new BABYLON.FreeCamera(“camera”, new BABYLON.Vector3(0.12,8.53,17.67),this.scene);
camera.setTarget(new BABYLON.Vector3( 0.128,8.15,16.76));
//camera.inputs.attached.pointers.buttons = [2];

    /*  const camera = new BABYLON.ArcRotateCamera("Camera", Math.PI/2,1.05,15, BABYLON.Vector3.Zero(), this.scene);
    camera.wheelDeltaPercentage = 0.008;
    camera.panningSensibility = 0; // this line block the panning but now the right button rotate the camera too.
    camera.attachControl(this.engine.getRenderingCanvas(), true);
    camera.inputs.attached.pointers.buttons = [2];

Hi @ranwei-001

Can you please make a playground to highlight your issue?

please wait

This is my PG, and now I can only press the button to control arcratatecam(), but freecam() does not have this function, what I want to achieve is to rotate the camera with the right mouse button and zoom in the pulley

Something like that? https://www.babylonjs-playground.com/#4AJ16M#177

No, I don’t want to do this with ArcRotateCam, I want to do it with a univercamera or freecam


1 Like

why are the playground examples all wrong

Because they are done by people :slight_smile:


It is of no value to show an image of a playground that is not working and ask why it is wrong. At a minimum give a link to the playground.

Also see this topic Some playgrounds not working after last update? where any issues with problem playgrounds is being discussed.

I think the question seems to be off the mark. Why is it that only ArcRotateCam has pull, pull, and button (mouse) control of its rotation, while Freecam doesn’t?