WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #1  
Old 11-08-2004, 11:58 AM
vr_boyko vr_boyko is offline
Member
 
Join Date: Sep 2004
Posts: 19
does viz.go() have an antidote?

I am looking for a command: maybe viz.stop()
that simply kills all timers, and "freezes" keyboard/mouse inputs but does not kill the head tracking...
right now, I am using an infinite loop, which is by far the least elegant of ways... but it stops the user once thir time is up.

Also, is there a way to put a "console" message (something like "Thank you for your participation") in the user's view after their time is up (and the above STOP command has been issued)

Thanks!
Reply With Quote
  #2  
Old 11-08-2004, 12:31 PM
vr_boyko vr_boyko is offline
Member
 
Join Date: Sep 2004
Posts: 19
viz.waittime is not much better than an infinite loop

I substituted the infinite loops with the following snippet:

Code:
endLabel.message("Thank you for your participation!")viz.waittime(5)
viz.quit()
However, this does not have the desired effect of displaying a thank-you message for 5 seconds before quitting, instead, it idels for 5 secods, flashes the thank-you message for a split-second, and quits ....

I have had trouble with viz.waititme on other occasions.
Can you please explain the correct way to use it or suggest alternative solutions to my problem (see previous post)

Thanks again.
Reply With Quote
  #3  
Old 11-08-2004, 12:33 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The command viz.pause will freeze all current timers, which can later be resumed with viz.play(). This doesn't stop keyboard and mouse events though. An alternative might look something like this:
Code:
def StopEvents():
	viz.callback(viz.KEYBOARD_EVENT,0)
	viz.callback(viz.TIMER_EVENT,0)
	viz.callback(viz.MOUSEDOWN_EVENT,0)

def ResumeEvents():
	viz.callback(viz.KEYBOARD_EVENT,onkeydown)
	viz.callback(viz.TIMER_EVENT,ontimer)
	viz.callback(viz.MOUSEDOWN_EVENT,onmousedown)
You can then use these functions to freeze/resume input.

To display text to the user you can create a text object like so:
Code:
text = viz.add(viz.TEXT3D,'Thank you for your participation',viz.SCREEN)
#Place in the middle of the screen
text.translate(0.5,0.5)
#Set alignment to center of message
text.alignment(viz.TEXT_CENTER_CENTER)
#Initially hide the text
text.visible(0)
When you want to display the message to the user simply make the text visible.
Reply With Quote
  #4  
Old 11-08-2004, 12:38 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

viz.waittime should only be used with director functions. If you use the command outside a director function then it affectly freezes the graphics engine for 5 seconds. The following code shows how to accomplish this with director functions:
Code:
def DisplayMessageAndQuit():
	endLabel.message("Thank you for your participation!")
	viz.waittime(5)
	viz.quit()
To trigger the director function simply do the following:
Code:
viz.director(DisplayMessageAndQuit)
Reply With Quote
Reply


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 09:38 PM.


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