lordTouch Posted September 28, 2018 Share Posted September 28, 2018 Does Babylon have a feature that indicates how much the user has pinched to zoom in or out? I want to attach an event for whenever they try to zoom in or out using their touch device. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 28, 2018 Share Posted September 28, 2018 Hi LT, welcome. Not sure, but this might be a cool place to start: https://medium.com/@auchenberg/detecting-multi-touch-trackpad-gestures-in-javascript-a2505babb10e "gestures" is the secret search term. :) http://www.html5gamedevs.com/topic/32449-picking-up-pinch-to-zoom-gesture/?do=findComment&comment=186257 Found via forum search... http://www.html5gamedevs.com/search/?&q=gestures&type=forums_topic&nodes=28,29,30,31,38&search_and_or=or Others will give more/better comments, soon, I almost promise. :) Quote Link to comment Share on other sites More sharing options...
lordTouch Posted September 30, 2018 Author Share Posted September 30, 2018 On 9/28/2018 at 3:34 PM, Wingnut said: Hi LT, welcome. Not sure, but this might be a cool place to start: https://medium.com/@auchenberg/detecting-multi-touch-trackpad-gestures-in-javascript-a2505babb10e "gestures" is the secret search term. http://www.html5gamedevs.com/topic/32449-picking-up-pinch-to-zoom-gesture/?do=findComment&comment=186257 Found via forum search... http://www.html5gamedevs.com/search/?&q=gestures&type=forums_topic&nodes=28,29,30,31,38&search_and_or=or Others will give more/better comments, soon, I almost promise. Hi Wingnut! Thank you so much for replying! I think I found a cheaper way to do the functionality that I wanted earlier using only babylonjs! But, I ran into another problem. Although a little irrelevant from the question, would you happen to know another way to reverse camera movement without using something like camera.angularSensibilityX = -camera.angularSensibilityX? This reverses the touch pinch gestures and it's an inconvenience when the user wants to zoom in but it actually zooms out lol. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 30, 2018 Share Posted September 30, 2018 Hiya LT... my pleasure. I found an interesting property in the arcRotateCam pinch code... https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.arcRotateCameraPointersInput.ts#L64 https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.arcRotateCameraPointersInput.ts#L206 It looks like you can set arcCamera.pinchInwards to true or false. Give that a try... see what happens. I use an Ipad 4 to tour my "Physics Phlyer" playground fairly often, which has an arcCam as its primary cam. By default, for me and my tablet: - "spread" = dolly-in/zoom - "pinch" = dolly-out/unzoom. For me, this seems correct, because the craft gets bigger on a spread-gesture, and smaller on a squeeze (pinch) -gesture. But you might need it to act reversed... and that's okay, too. Try that Boolean property... it should work (in theory). Good luck, report back, as wanted. 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.