WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC