Jump to content

Touch Pinch Scaling?


lordTouch
 Share

Recommended Posts

Link to comment
Share on other sites

On ‎9‎/‎28‎/‎2018 at 3:34 PM, Wingnut said:

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.

Link to comment
Share on other sites

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.

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...