WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 03-19-2009, 12:34 AM
nlfrnassimi nlfrnassimi is offline
Join Date: Feb 2009
Posts: 37
Question reseting actions

Hi, I have created a test code. In my code there is a ball that waits 5 seconds before it changes color, and according to the color changing there are balls moving around. after the actions have taken place, I want to reset them so that everything starts from the beginning. How can I do that?

Here is my code:

import viz


import viztask

viz.clearcolor( viz.SKYBLUE )
viz.add( 'tut_ground.wrl' )
ball1 = viz.add( 'white_ball.wrl' )
ball1.setPosition( 0, 3, 4 )

ball2 = viz.add('soccerball.ive')

ball3 = viz.add('soccerball.ive')

def changeColor():
	while True:
		color = ball1.color(viz.RED)

		yield viztask.waitTime( 5 ) 
		color = ball1.color(viz.YELLOW)
		yield viztask.waitTime(5)

		color = ball1.color(viz.GREEN)

		yield viztask.waitTime( 5 )
viztask.schedule( changeColor() )

def moveball2 ():
	ball2.addAction( vizact.goto ([-1,2,6] ) )

def moveball3 ():
	ball3.addAction( vizact.goto ([2,2,6] ) )
def rotateball3 ():
	ball3.addAction( vizact.spin([0,1,0],90,viz.FOREVER,100))

def stopRotate ():
def safe() :
	safe = viz.addText('SAFE', viz.WORLD)
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to synchronize avatar actions mjabon Vizard 1 07-29-2008 11:15 AM
question regarding actions dan12345 Vizard 1 03-26-2008 11:28 AM
Spin Actions and rotations Vinicius Lima Vizard 1 10-22-2007 11:49 AM
Speech during actions zoltantoth Vizard 2 05-02-2007 03:11 PM
Weird lagging/choppiness when avatars perform actions vjonshih Vizard 8 11-30-2004 04:08 PM

All times are GMT -7. The time now is 04:29 AM.

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