Thread: VizTouch Help!
View Single Post
  #1  
Old 08-14-2014, 04:10 AM
Majestic12 Majestic12 is offline
Member
 
Join Date: Apr 2014
Posts: 10
VizTouch Help!

Hello!

First of all I would like to say thank you for a wonderful software. I have had hours of fun creating various virtual environments.

I have just recently purchased a touch-screen and started exploring the VizTouch module and I have a little issue, maybe you can help!

I have a cube that I want to look around using setEuler. I disabled the regular mouse navigation but I can't seem to figure out how to determine which way I want to rotate. In terms of touch I want this:

Code:
def begin(e):
#Begin touch

def move(e):
#On move, determine which direction it is moving and rotate the around the 
cube appropriately. As long as the touch persists, keep rotating slowly. 

def end(e):
#End touch

viztouch.onTouchDown(begin)

viztouch.onTouchMove(move)

viztouch.onTouchUp(end)
I tried to do a similar thing with the gestures, but it turned out fairly clunky. I had to do flicks repeatedly and each time would move the view a fixed distance:

Code:
def gesturemethod(typen):
	
if (typen == 'left'):
     #cube.setEuler...
elif (typen == 'right'):
     #cube.setEuler...
elif (typen == 'up'):
     #cube.serEuler...
elif (typen == 'down'):
     #cube.setEuler...

viztouch.onGestureFlick(viztouch.FLICK_UP,gesturemethod, 'up')

viztouch.onGestureFlick(viztouch.FLICK_DOWN,gesturemethod, 'down')

viztouch.onGestureFlick(viztouch.FLICK_RIGHT,gesturemethod, 'right')

viztouch.onGestureFlick(viztouch.FLICK_LEFT,gesturemethod, 'left')
I would like to do a smooth solution with the touch one but I can't seem to figure out how to do it smoothly. I would be appreciative of any help I can get in this! How do I determine which way a touch is moving and then set the euler accordingly?

Thanks!!
M12
Reply With Quote