Ariel Yust Posted December 16, 2013 Share Posted December 16, 2013 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 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 ! Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 16, 2013 Share Posted December 16, 2013 Hi Ariel, To limit the camera zoom, you can use this : if (camera.radius > 70) camera.radius = 70;if (camera.radius < 5) camera.radius = 5; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 16, 2013 Share Posted December 16, 2013 You can also use:camera.lowerRadiusLimitcamera.upperRadiusLimit shahrukh4 and DesignVibe 2 Quote Link to comment Share on other sites More sharing options...
Ariel Yust Posted December 18, 2013 Author Share Posted December 18, 2013 Or I can use both and do this: camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius;Muhahaha 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; Tomek, bviale and Anu 1 2 Quote Link to comment Share on other sites More sharing options...
Ariel Yust Posted December 19, 2013 Author Share Posted December 19, 2013 sooo.... no one answered this: how do I invert the direction the camera moves when I drag the mouse on screen ? dragging mouse left should move pin camera right and vise verse... how to achieve that ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 19, 2013 Share Posted December 19, 2013 You have to update the code of the ArcRotateCamera if you are not happy with its default behavior Or better way: create a new camera that inherits from ArcRotatecamera and just update the function which is responsible for the movement Quote Link to comment Share on other sites More sharing options...
Ariel Yust Posted December 22, 2013 Author Share Posted December 22, 2013 Later option seems more practical, thanks I'll try that and share my results! it might take a while because I'm dealing with other issues in the code =] Quote Link to comment Share on other sites More sharing options...
Kev Posted May 10, 2015 Share Posted May 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
Gerente Posted July 26, 2015 Share Posted July 26, 2015 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; bviale 1 Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 26, 2015 Share Posted July 26, 2015 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? Quote Link to comment Share on other sites More sharing options...
Gerente Posted July 27, 2015 Share Posted July 27, 2015 I was looking something else in the forum and I stoped in your post, and, since I just solve that today I decide to share it. Coincidence I guess. Quote Link to comment Share on other sites More sharing options...
rgalindox Posted August 2, 2017 Share Posted August 2, 2017 Hi, in which part of the code should I add the camera limits for the zoom? or when it is triggered? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 3, 2017 Share Posted August 3, 2017 You can do it right after creating the camera. It will be trigger on every mouse wheel Quote Link to comment Share on other sites More sharing options...
rgalindox Posted August 3, 2017 Share Posted August 3, 2017 Thanks! Quote Link to comment Share on other sites More sharing options...
maxxcan Posted May 8, 2018 Share Posted May 8, 2018 Thank you very much!! I need this Quote Link to comment Share on other sites More sharing options...
shahrukh4 Posted October 16, 2020 Share Posted October 16, 2020 On 12/16/2013 at 8:43 PM, Deltakosh said: You can also use: camera.lowerRadiusLimit camera.upperRadiusLimit Thanks for the help, I was struggling from days for doing this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.