Having trouble creating a pinch to scale in our 3js project

Hi All, we are having trouble with the scaling feature in 3JS. When we were using A-Frame we could implement pinch to zoom but now the only way is through create a slider. Can someone help me figure out how to include Pinch to Zoom?

Thanks so much.

Hello @Adrian_Rashad_Drisco do you mean pinch to scale? As in to scale up a 3D model when you pinch your fingers?

Can you please clarify? Or do you mean some sort of pinching to zoom in the camera mechanic?

Hi @Ian, yes I meant to scale sorry.

You can look further to the code behind the pinch scale component here:

And use this logic to create a custom component for three.js or code if needed

Perfect! Thank you! This is exactly what we needed.

1 Like