Vtk-js: mobile pan problem

Created on 8 Jul 2020  路  9Comments  路  Source: Kitware/vtk-js

We want to use mobile double touch and pan, however we failed to use double touch action.

How can I use a double touch in my mobile circumstance?

Here is my code.

const fullScreenRenderer = vtk.Rendering.Misc.vtkFullScreenRenderWindow.newInstance({ background: [0.2,0.2,0.2]});

const renderer = fullScreenRenderer.getRenderer();
const renderWindow = fullScreenRenderer.getRenderWindow();

const interactorStyle = vtk.Interaction.Style.vtkInteractorStyleManipulator.newInstance();

const TrackballRotateManipulator = vtk.Interaction.Manipulators.vtkMouseCameraTrackballRotateManipulator.newInstance({ button: 1, });
const TrackballZoomManipulator = vtk.Interaction.Manipulators.vtkMouseCameraTrackballZoomManipulator.newInstance();
const TrackballPanManipulator = vtk.Interaction.Manipulators.vtkMouseCameraTrackballPanManipulator.newInstance({ button: 1, shift: true, });

interactorStyle.addMouseManipulator(TrackballRotateManipulator);
interactorStyle.addMouseManipulator(TrackballZoomManipulator);
interactorStyle.addMouseManipulator(TrackballPanManipulator);

TrackballZoomManipulator.setScrollEnabled(2);

fullScreenRenderer.getInteractor().setInteractorStyle(interactorStyle);

//always get gesture
//const CompositeGestureManipulator = vtk.Interaction.Manipulators.vtkCompositeGestureManipulator.newInstance();
const GestureCameraManipulator = vtk.Interaction.Manipulators.vtkGestureCameraManipulator.newInstance();
interactorStyle.addGestureManipulator(GestureCameraManipulator);

Most helpful comment

@floryst it will be really nice especially if you have time. I'm currently swamp and can't be of much help right now.

All 9 comments

Hi, I don't think double touch is supported, but would be very useful to add. For reference, the touch handling code is here: RenderWindowInteractor#L552. I may take a closer look later.

@jourdain what do you think?

@floryst it will be really nice especially if you have time. I'm currently swamp and can't be of much help right now.

I'll take a look into it.

@floryst Did you figured it out?
I'm dealing with this problem, I think the vtk.js library doesn't support the multi-touch function on mobile invironment.
I think we can solve it with add a translucent button in mobile interface way.
The solution is, when someone touch and drag this button, the object going to panning on the mobile web invorionment.

But I want to solve this issue by implement multi-touch panning function, not the other litte tricks.
If you still looking this problem, tell me which step you currently on.

I'm beginning to look into it, and there appears to be some multi-touch pan code from a first glance, but I haven't verified. My initial plan is to add code that handles pan/pinch/rotate, and then figure out how we would want to integrate it. Maybe a multitouch event that users can then decide what to do with it.

Check out PR #1542. It should resolve the pan issues.

You can now check out the InteractorStyleManipulator example on your smartphone and it should support two-finger pan via vtkGestureManipulator.

Thank you so much!.

@floryst Thank you!
@jourdain Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjsgml5698 picture rjsgml5698  路  4Comments

mix3d picture mix3d  路  5Comments

aminechir picture aminechir  路  3Comments

rjsgml5698 picture rjsgml5698  路  4Comments

doczoidberg picture doczoidberg  路  5Comments