• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python viztask.waitTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中viztask.waitTime函数的典型用法代码示例。如果您正苦于以下问题:Python waitTime函数的具体用法?Python waitTime怎么用?Python waitTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了waitTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: reachTeapotTask

def reachTeapotTask():
	tryNum = 0
	while(True) :
		global reachedTeapot
		reachedTeapot = False
		global avoidCat
		avoidCat = True

		# Action for hiding/showing text
		DelayHide = vizact.sequence( vizact.waittime(8), vizact.method.visible(False) )
		Show = vizact.method.visible(True)

		instructions.setText("Welcome!")
		instructions.runAction(DelayHide)
		yield viztask.waitTime(5)
		instructions.runAction(Show)
		instructions.setText("Now, try to get the teapot without touching the cat in 15 seconds!")
		instructions.runAction(DelayHide)
		yield viztask.waitTime(15)
		instructions.runAction(Show)

		instructions.setText("Reached Teapot: "+str(reachedTeapot)+" Avoided Cat: "+str(avoidCat))
		yield viztask.waitTime(5)
		yield ClapTask()
		tryNum = tryNum + 1
		data = 'Try '+str(tryNum)+' Reached Teapot: '+str(reachedTeapot)+' Avoided Cat: '+str(avoidCat)+'\n'
		teapot_game_data.write(data)
		instructions.setText("Now, try again or exit to leave!")
		yield viztask.waitTime(5)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:29,代码来源:FridayScript.py


示例2: testPhase

def testPhase():
    info.setText("Experiment running")
    info.visible(viz.ON)
    vizact.ontimer(1, getData)
    yield viztask.waitTime(10)
    
    info.setText("Experiment over")
    yield viztask.waitTime(2)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:8,代码来源:pit.py


示例3: walk

def walk():
	while (True) :
		yield viztask.addAction(cat,vizact.walkTo([2.8, 0, -3], walkSpeed = 1.5, turnSpeed = 1, walkAnim = 4))
		yield viztask.waitTime(1.5)
		yield look1()
		yield viztask.addAction(cat,vizact.walkTo([-2.8, 0, -3], walkSpeed = 1.5, turnSpeed = 1, walkAnim = 4))
		yield viztask.waitTime(1.5)
		yield look2()
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:8,代码来源:FridayScript.py


示例4: endingPhase

def endingPhase():
	childLookAtYou()
	windAudio.stop()
	endingAudio.play()
	yield viztask.waitTime(CHILD_RECOVERY_TIME)
	childModel.state(6)
	yield viztask.waitTime(endingAudioBasic.getDuration() - CHILD_RECOVERY_TIME)
	yield viztask.waitTime(END_TIME)
	finish()
开发者ID:vhilab,项目名称:Demos,代码行数:9,代码来源:Flying_Demo_2015.py


示例5: policeApproach

def policeApproach(scene=viz.MainScene):
    yield viztask.waitTime(TIME_BEFORE_POLICE)
    addSirens(scene)
    yield viztask.waitTime(sirenAudio.getDuration())
    moveFlashlightToCar(scene, POLICE_WALK_TIME)
    yield viztask.waitTime(POLICE_WALK_TIME)
    footstepsAudio.stop()

    global flashlight
    policeOfficerAudio = flashlight.playsound("resources/audio/PoliceOfficer.wav")
开发者ID:vhilab,项目名称:homelessness-study,代码行数:10,代码来源:PoliceNarrative.py


示例6: testPhase

def testPhase():
	info.setText("Testing")
	info.visible(viz.ON)
	position = viz.MainView.getPosition()
	data = 'position:' + '\n'+str(position)
	data_file.write(data)
	yield viztask.waitTime(5)
	info.visible(viz.OFF)
	info.setText("Experiment finished testing phase")
	info.visible(viz.ON)
	yield viztask.waitTime(2)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:11,代码来源:megha_day3_challenge6.py


示例7: walking

def walking():
	yield viztask.waitKeyDown(' ')
	male.addAction(vizact.walkTo([1, 0, 0]))
	yield vizproximity.waitEnter(femaleSensor)
	female.state(3)
	yield viztask.waitTime(2)
	male.state(33)
	yield viztask.waitTime(3)
	male.addAction(vizact.walkTo([-4, 0, 0], walkAnim = 70, walkSpeed = 2))
	yield vizproximity.waitExit(femaleSensor)
	female.state(8)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:11,代码来源:Test_Room_Script+sample.py


示例8: prepareForObjectSelling

def prepareForObjectSelling( obj ):
	global SCENE, APARTMENT, OBJECTS, RIFT
	audio = obj.narrationFile[0]
	sound = viz.addAudio(audio)
	duration = sound.getDuration()
	yield viztask.waitTime(1)
	sound.play()
	print "now playing audio for prepare for selling object"
	yield viztask.waitTime(duration)
	ObjectSelling.init(APARTMENT, OBJECTS, SCENE, RIFT)
	ObjectSelling.enable()
开发者ID:vhilab,项目名称:homelessness-study,代码行数:11,代码来源:ApartmentNarration.py


示例9: learnPhase

def learnPhase():
    # provide instructions for the participant
    info.setText("You'll have 30 seconds to explore")
    info.visible(viz.ON)

    # hide instructions after 5 seconds
    yield viztask.waitTime(5)
    info.visible(viz.OFF)

    # let participant know learning phase has ended
    yield viztask.waitTime(30)
    Reset()
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:12,代码来源:PitDemo.py


示例10: findCup

def findCup(bottle):
	disableSelector()
	
	yield moveToDash(bottle)
	yield viztask.waitTime(TIME_BETWEEN_TASKS) # wait a bit before next task

	#Play instructions.
	cupInstructions = car.playsound('resources/audio/find_cup_audio.wav')
	#Wait for instructions to end
	yield viztask.waitTime(cupInstructions.getDuration())
	
	enableSelector([cup1, cup2])
开发者ID:vhilab,项目名称:homelessness-study,代码行数:12,代码来源:PosessionHunting.py


示例11: findBottle

def findBottle():
	disableSelector()
	
	yield moveToDash(toothPaste)
	yield viztask.waitTime(TIME_BETWEEN_TASKS) # wait a bit before next task
	
	#Play instructions.
	bottleInstructions = car.playsound('resources/audio/find_bottle_audio.wav')
	#Wait for instructions to end
	yield viztask.waitTime(bottleInstructions.getDuration())
	
	enableSelector([bottle1, bottle2, bottleCap1, bottleCap2])
开发者ID:vhilab,项目名称:homelessness-study,代码行数:12,代码来源:PosessionHunting.py


示例12: findToothBrush

def findToothBrush():
	#Wait for start of experiment
	yield viztask.waitTime(3)
	
	#Play instructions.
	toothBrushInstructions = car.playsound('resources/audio/find_toothbrush_audio.wav')
	
	#Wait for instructions to end.
	yield viztask.waitTime(toothBrushInstructions.getDuration())
	
	#enable selector
	selector.enable()
开发者ID:vhilab,项目名称:homelessness-study,代码行数:12,代码来源:PosessionHunting.py


示例13: playPhoneAndRadio

def playPhoneAndRadio():
	
	global main_screen, radio, selector, phoneEvent
	yield screen.playsound('resources/audio/vibrate.wav', viz.STOP)
	yield selector.disable()
	yield selector.disable()
	yield screen.endAction( pool = 0)
	yield vizact.removeEvent(phoneEvent)
	voicemail = screen.playsound('resources/audio/voicemail_mono.wav', viz.PLAY)
	yield viztask.waitTime(voicemail.getDuration())
	newsReport = radio.playsound('resources/audio/RadioShowScene_louder.wav')
	yield viztask.waitTime(newsReport.getDuration())
	viz.sendEvent(INTRO_OVER_EVENT)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:13,代码来源:PhoneRadio.py


示例14: setupTarget

def setupTarget():
	viztask.waitTime(5)
	target = viz.add('arm/all_target.wrl')
	target.setScale(.01, .01, .01)
	target.setEuler(0, 90, 0)
	target.setPosition([-1.35, 1.5, -1.5])
	reportTargetTime()
	
	#Adds invisible cube that launches fire
	global targetcube 
	targetcube = []
	targetcube.append(TouchCube())
	targetcube[0].setPosition([-1.35, 1.5, -1.5])
开发者ID:vhilab,项目名称:thirdArm,代码行数:13,代码来源:touchcube.py


示例15: findToothPaste

def findToothPaste():
	disableSelector()
	
	yield moveToDash(toothBrush)

	lowerBlanket()
	yield viztask.waitTime(TIME_BETWEEN_TASKS) # wait a bit longer before new instructions
	
	#Play instructions.
	toothPasteInstructions = car.playsound('resources/audio/find_toothpaste_audio.wav')
	#Wait for instructions to end
	yield viztask.waitTime(toothPasteInstructions.getDuration())
	
	enableSelector([toothPaste,cap,cup1])
开发者ID:vhilab,项目名称:homelessness-study,代码行数:14,代码来源:PosessionHunting.py


示例16: startZone3Hunt

def startZone3Hunt():
 global SWIM_ZONE_TO_ZONE_COMPLETE_EVENT
# yield viztask.waitEvent(scavengerhunt.ZONE1_OVER_EVENT)
# print "waiting for swimming to end"
# yield viztask.waitEvent(SWIM_ZONE_TO_ZONE_COMPLETE_EVENT)
# scavengerhunt.disableGrabber()
# globals_oa.basket.disable(viz.RENDERING)
 yield fader.fadeOutTask()
 globals_oa.AUDIO_ZONE_CUT_AMBIENT.play()
# globals_oa.ZONE3_TRANSITION.play()
 
 
 #Untested fish hiding
# for school in schooling.all_fish_schools:
#   chromis_chromis.hidePercentage(20)
#   diplodus_annularis.hidePercentage(100)
#   labrus_viridis.hidePercentage(100)
#   sarpa_salpa.hidePercentage(20)
 for school in schooling.all_fish_schools:
  school.hidePercentage(50)
 globals_oa.currentZoneNumber = 2
 transport_vhil.cycleZones()
 #viz.res.addPublishFile('data/speciesToFindZone3.txt')
 #scavengerhunt.initialize(globals_oa.terrainZone3, globals_oa.filePathToSpeciesForScavengerHuntInZone3) 
 #Enable swimming 
 yield fader.fadeInTask()
 globals_oa.AUDIO_ZONE3_AMBIENT.play()
 yield viztask.waitTime(3)
 globals_oa.ZONE3_AUDIO_1.play()
# playAudioAndSaveGlobalPointer(globals_oa.ZONE3_AUDIO_1)
 viztask.schedule(startBoatOutro())
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:31,代码来源:TheCrystalReef.py


示例17: destinationsTask

def destinationsTask():

    # Action for hiding/showing text
    DelayHide = vizact.sequence( vizact.waittime(8), vizact.method.visible(False) )
    Show = vizact.method.visible(True)

    yield viztask.waitTime(6)
    instructions.setText("Walk around!")
    instructions.runAction(DelayHide)
    yield viztask.waitTime(30)
    instructions.runAction(Show)
    instructions.setText("Thank you for your participation :)")

    #Show results of experiment
    print 'Avoided avatar:',avoidAvatar
    print 'Avoided cat:',avoidCat
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:16,代码来源:AvatarScript.py


示例18: showHiddenMolecules

def showHiddenMolecules():
	yield viztask.waitTime(0.5)
	for mole in LIST_OF_FALLING_MOLES:
		node = globals_oa.boat.getChild(mole)
		node.enable(viz.RENDERING)
	mole1 = globals_oa.boat.getChild('mole1')
	mole1.setAnimationSpeed(2)
	mole2 = globals_oa.boat.getChild('mole2')
	mole2.setAnimationSpeed(.7)
	mole3 = globals_oa.boat.getChild('mole3')
	mole3.setAnimationSpeed(2.3)
	mole4 = globals_oa.boat.getChild('mole4')
	mole4.setAnimationSpeed(1.2)
	mole9 = globals_oa.boat.getChild('mole9')
	mole9.setAnimationSpeed(1.5)
	mole12 = globals_oa.boat.getChild('mole12')
	mole12.setAnimationSpeed(0.8)
	mole15 = globals_oa.boat.getChild('mole15')
	mole15.setAnimationSpeed(1.9)
	mole20 = globals_oa.boat.getChild('mole20')
	mole20.setAnimationSpeed(0.7)
	mole21 = globals_oa.boat.getChild('mole21')
	mole21.setAnimationSpeed(1.4)
	mole25 = globals_oa.boat.getChild('mole25')
	mole25.setAnimationSpeed(1.1)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:25,代码来源:boat_scene.py


示例19: H2CO3formation

def H2CO3formation():
	global bigCO2, bigH2O, h2co3molecule, co2Path, lowPolyMole, highPolyMole, h2co3FormationTriggered
	
	h2co3FormationTriggered = True
	
	viz.sendEvent(globals_oa.H2CO3_COMPLETION_EVENT)
	
	#none of the following calls work to get the correct 3d position, phew!
#	x,y,z = bigH2O.getPosition(viz.ABS_GLOBAL)
#	x,y,z = bigH2O.getBoundingBox().center
	#hardcoded value below, until the sunny day when Worldviz gets us a call for the correct position of a 3d node!
	co2Path.remove()
	x,y,z = globals_oa.h2OLocationUntilWeChangeAgain[0], globals_oa.h2OLocationUntilWeChangeAgain[1], globals_oa.h2OLocationUntilWeChangeAgain[2]
	print x,y,z
	moveToH2O = vizact.moveTo([x,y,z] , speed = .75)
	yield viztask.addAction(bigCO2, moveToH2O)
	#yield viztask.waitTime(.05)
	#Fade molecules from bigCO2 and bigH2O to H2CO3 animation
	h2co3molecule.setPosition(globals_oa.h2CO3LocationUntilWeChangeAgain)
	lowPolyMole.enable(viz.RENDERING)
	highPolyMole.disable(viz.RENDERING)
	h2co3molecule.visible(viz.ON)
	h2co3molecule.setAnimationTime(8.9) #starts animation at 17.8 seconds
#	h2co3molecule.setAnimationSpeed(0.1)
	h2co3molecule.setAnimationLoopMode(0)
#	viztask.waitTime(.5)
	fadeOut = vizact.fadeTo(0, time=1)
	lowPolyMole.addAction(fadeOut)
	bigH2O.addAction(fadeOut)
	yield viztask.waitTime(5)
	bigCO2.visible(viz.OFF)
	bigH2O.visible(viz.OFF)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:32,代码来源:boat_scene.py


示例20: getCoords

def getCoords(source, destination):
	"""
	source should be a 3D connection device, and 
	the destination should be a 3d node type
	"""
	#set source scale
	scale1 = [.001,.001,.001]
	scale2 =[.01,.01,.01]
	#device.setTranslateScale(scale2)
	#device.setRotateScale(scale)
	
	while True:
		yield viztask.waitTime( .01 ) 
		position = source.getRawTranslation()
		orientation = source.getRawRotation()
		
		#rescale position
		position = scalarMult(position,scale1)
		orientation = scalarMult(orientation,scale2)
		
		#invert signs of x and z 
		x,y,z = position
		position = [-x,y,-z]
		
		#invert signs of x and z rotations, and exchange b and a
		a,b,g = orientation
		orientation = [b,-a,-g]
		
		
		#print(orientation)
		destination.setPosition(position, viz.REL_PARENT)
		destination.setEuler(orientation, viz.REL_PARENT)
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:32,代码来源:Control.py



注:本文中的viztask.waitTime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.coll函数代码示例发布时间:2022-05-26
下一篇:
Python viztask.schedule函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap