Forum

Creating a Camera (Transform Touch)


#1

Hi all.

For an upcoming project, I need to create a Camera controlled by a touch screen. The features would be :

  • One finger drag : orbit
  • Two fingers drag : pan
  • Classic two fingers zoom in/out : zoom in/out

Thanks to the Editing Framework, this seems to be easily doable (all I did was creating TouchCamControl vl plugin).

Right now though I’m struggling with a few things :

  • For some reason on startup, the cam “shakes” when you touch the screen. After making a few gestures, all works fine.
  • Sometimes, when going fullscreen, the cam simply does not react to any gesture
  • As I’m not familiar with event thingies, the way I’m handling the behaviors (see the OrbitBehavior, PanBehavior and ZoomBehavior vl modules inside) might not be pretty clean. There are still some pretty anoying things like : orbit with one finger and then put another finger on the screen, and then cam’s interest moves instantly. I understand this comes from the HoldLatest node I’m using that sends the last finger and as a consequence moves the cam. Unfortunately I have no idea how to solve this right now :/

I think this could be a pretty cool feature to have.

So here’s where I am right now, any help is greatly appreciated :)

Thanks in advance

seb

EDIT : needs b36 to work, the VL node TouchCamControls will stay red otherwise :)

touch_cam.zip (18.9 KB)


#2

Cool. I would like to see it happening.


#3

Ok so after talking about this IRL, it seems I’m totally taking the wrong approach. My intent was to make a “spaceship” kind of camera, here I’m orbiting around a point of interest. Gotta dig deeper !


#4

Hey sebescudie! How is it going with this?


#5

Hey !

The schedule was a bit tight so I ended up using a modified version of Camera Transform WASD :)


#6

some remarks:

  • i’d say your approach is not so bad. creating a TouchCamControl is all you need to do. in fact you could even keep the original Camera (Transform Orbit) and simply connect the TouchCamControl to its “Camera Controls” input. like this different behaviors can be “chained” and they all work in parallal
  • the version you uploaded has an OR node to combine the Idle-state of the individual behaviors. this has to be an AND node. you must have fixed that for yourself already, otherwise nothing works
  • i don’t get the “shaking” you’re mentioning
  • regarding your problems differentiating the pan/zoom gestures: maybe @woei can say something about it…but i think basically instead of the TouchState you want the GestureState which already does the gesture tracking properly for you
  • maybe woei also knows about the issue with going fullscreen?