three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Examples: implemented multi touch rotate for trackball controls

Open surdu opened this issue 3 years ago • 5 comments

Related issue: N/A

Description

Implemented multi touch rotate for trackball controls, allowing to rotate the camera around it's look axis

https://user-images.githubusercontent.com/11520795/172782570-d96f2c8e-80f1-498c-bba7-bb662f5ef227.mp4

surdu avatar Jun 09 '22 06:06 surdu

https://raw.githack.com/surdu/three.js/trackball-touch-rotate/examples/misc_controls_trackball.html

Mugen87 avatar Jun 09 '22 07:06 Mugen87

Do you mind updating examples/jsm/controls/TrackballControls.js instead? Files in the example/js version are auto-generated.

Mugen87 avatar Jun 09 '22 07:06 Mugen87

My bad! Fixed it 😉

surdu avatar Jun 10 '22 08:06 surdu

Your code works like a charm!

I just wonder if every user of TrackballControls will be happy with this change since the default behavior is now different. Devs could consider the new behavior as buggy/unwanted.

What do you think about introducing a new flag that enables the new behavior? E.g. multiTouchRotate with default false.

Mugen87 avatar Jul 12 '22 14:07 Mugen87

@Mugen87 Sounds good! Pushed a commit that does that. Enabled it in examples for visibility, but the default in TrackballControls is false

surdu avatar Jul 21 '22 14:07 surdu

I have reverted the PR for now. A feature like multi touch rotate should not affect the existing usage of the controls

Mugen87 avatar Nov 01 '22 09:11 Mugen87

Agree. I'll investigate the issue and re-open another PR

surdu avatar Nov 01 '22 10:11 surdu