Jump to content

Stop mouswheel zoom but keep rotating


JayJay80
 Share

Recommended Posts

Hey guys,

I'm playing around with Babylon a little bit and the posibilities are amazing!

Maybe  a little to much at the beginning. This question maybe sounds silly for you but I still hope you can and will help me.

I tried to stop the camera zoom by mouseWheel but I want to keep the rotation but nothing I'm doing is working.

When I do this:

this.camera.attachControl(this.canvas, false, true)

I can zoom with the wheel and rotate with the keyboard and the wheel.

If I don't have this line I can't zoom but of course don't rotate either.

Is there a line I have to add or a parameter I need to set to false? I'm thankful for every suggestion.

Google wasn't much of a help.

Thanks.

Jay

 

Link to comment
Share on other sites

Hi,

Welcome!

You can disable or remove inputs (mousewheel, keyboard, etc.). You can read about this here:  

http://babylonjsguide.github.io/intermediate/Customizing_Inputs.html

A sample to show how you can disable the mousewheel input :

var cam = new BABYLON.ArcRotateCamera("cam1", 0, 0, 200, new BABYLON.Vector3(0, 0, 0), scene);

scene.activeCamera = cam1;
cam1.attachControl(canvas, true);

cam1.inputs.attached.mousewheel.detachControl(canvas);

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...