Ariel Yust

How to limit Camera's Zoom and change it's Direction ?

Recommended Posts

camera.lowerAlphaLimit;camera.upperAlphaLimit;camera.lowerBetaLimit;camera.upperBetaLimit;

I know these guys handle the bounding angles for the camera's angles on the azimuth and elevation (took me a while finding this out!),

but how about zoom ?

 

1) I want to disable or limit the zoom on the camera (the one you have when using wheel up/down) how do I do that ?

 

2) also, how do I invert the direction that the camera moves when I drag the mouse on screen ?

 

I mean right now I hold the mouse key and drag right and the camera turns right... it should turn left, like every touch interface in the world  :P

do I need to go into babylon.js and change it manually, or is there something I don't know about ?

 

Thanks for the help !  B)

Share this post


Link to post
Share on other sites

Or I can use both and do this:
 

camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius;

Muhahaha  :lol:

 

actualy it does zoom in abit for less then a second and then get back to the original zoom, I guess a fix should be made ?

I didn't put it in a loop, just assigned it once;

Share this post


Link to post
Share on other sites

In case anyone else finds this while looking for a way to disable the zoom on ArcRotateCamera.
 

canvas.removeEventListener('mousewheel', camera._wheel);canvas.removeEventListener('DOMMouseScroll', camera._wheel); 

Re-adding is as simple as doing the reverse with addEventListener.

Share this post


Link to post
Share on other sites

1) I want to disable or limit the zoom on the camera (the one you have when using wheel up/down) how do I do that ?

 

camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius = 1;  

2) also, how do I invert the direction that the camera moves when I drag the mouse on screen ?

var camera = new BABYLON.ArcRotateCamera("Camera", 1 , Math.PI / 2, 1, BABYLON.Vector3.Zero(), scene);        camera.attachControl(canvas, true);    camera.fov = 90;//Invert rotation of the camera by dragging the mousecamera.angularSensibility = -5000;

Share this post


Link to post
Share on other sites

Hehee... I realized that today, too, when I answered on another topic that you can use a negative angular sensibility to invert the movement ... did you read the other topic or was it just a coincidence that we both find this today?  :D

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.