![]() |
|
#1
|
|||
|
|||
you can try using viz.mouseScale() and set the scale factor for the navigation to 0 and then switch it back to 1 when you want the simulation to move again.
For example: Code:
def goStopTask(): viz.mouse.setScale(0,0) yield viztask.waitTime( 2) viz.mouse.setScale(1,1) vizact.onkeydown( ' ', viztask.schedule, goStopTask ) Best, Masaki |
#2
|
|||
|
|||
Thanks, masaki, for your idea!
Unfortunatelly, it leads exactly to the same result as the mouse-on-mouse-off approach. My code is something like this: Code:
import viz import viztask def SetTrial( configuration ): # ... # Middle mouse button or spacebar picks object vizact.onmousedown( viz.MOUSEBUTTON_MIDDLE, pickObject ) vizact.onkeydown( ' ', pickObject ) # Loop through all trials for i in range( TRIALS ): # ... # Prepare VE viz.go() viz.mouse( viz.OFF ) viz.MainView.eyeheight( EYEHEIGHT ) viz.clearcolor( SKYCOLOR ) viz.collision( viz.ON ) # -------------------------------------- # if ( WAIT_FOR ): yield viztask.waitTime( WAIT_FOR ) else: yield viztask.waitKeyDown(' ') # -------------------------------------- # # Position the user viz.MainView.setPosition( Xc, Yc, Zc ) viz.MainView.setEuler( Yr, Pr, Rr ) # Enable mouse navigation viz.mouse( viz.ON ) # Register callback for timers viz.callback( viz.TIMER_EVENT,onTimer ) viz.starttimer( 0, 0, viz.PERPETUAL ) viz.starttimer( 1, .05, viz.PERPETUAL ) # Wait till the trial is over yield viztask.waitTime( DURATION ) # Disable user's activities viz.mouse( viz.OFF ) viz.killtimer(0) viz.killtimer(1) # ... # Start Vizard viz.go() viz.clearcolor( viz.SKYBLUE ) # Schedule Task viztask.schedule( SetTrial( configuration ) ) Maybe the problem is due to the structure of my code, however, I could not find an explanation so far... So any help would be appreciated! ![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Realistic Light and Shadows Using Vizard and 3DS Max | jde | Vizard | 4 | 07-13-2012 10:58 AM |
.3DS importing in Vizard and 3D Studio | jde | Vizard | 1 | 08-28-2009 03:14 PM |
Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 11:13 AM |
Vizard tech tip: Text to Speech | Jeff | Vizard | 1 | 01-15-2009 09:39 PM |
Vizard won't run | wouters | Vizard | 5 | 02-05-2008 11:12 AM |