本文整理汇总了Python中vizact.ontimer函数的典型用法代码示例。如果您正苦于以下问题:Python ontimer函数的具体用法?Python ontimer怎么用?Python ontimer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ontimer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, offset, particle=None, sensorNum=0, attachTo=viz.MainView, preTrans = [0, 0, 0.1778]) :
viz.EventClass.__init__(self)
self.offset = offset
self.particle = particle
self.sensorNum = sensorNum
self.attachTo = attachTo
self.preTran = preTrans
self.off = True
self.vrpn = viz.add('vrpn6.dle')
self.tracker = self.vrpn.addTracker('[email protected]', sensorNum)
self.tracker.swapPos([1,3,2])
self.tracker.swapQuat([-1,-3,-2,4])
self.preMat = vizmat.Transform()
self.preMat.preEuler([-90, 0, 0]);
self.preMat.preTrans(self.preTran);
self.postMat = vizmat.Transform();
self.postMat.postTrans(offset);
vizact.ontimer(0, self.updateView)
self.pos = [0,0,0]
self.rot = [0, 0, 0, 0]
self.turnOn()
开发者ID:YanjieGao,项目名称:ExperimentBase,代码行数:27,代码来源:HiBallCameraMT.py
示例2: main
def main():
global wingl
global wingr
viz.cam.setHandler(vizcam.KeyboardCamera())
myo.init()
gyrolist = [[0,0,0]]
viz.setMultiSample(4)
viz.fov(150)
wingl = viz.addChild('basketball.osgb')
wingl.setScale([10,0.3,1])
wingl.setCenter([100,100,100])
wingl.setEuler([0,90,0])
wingl.collideSphere(0.5)
lStartPOS = [ 0, 2.5, 2 ]
wingl.setPosition( lStartPOS )
wingr = viz.addChild('basketball.osgb')
wingr.setScale([10,0.3,1])
wingr.setCenter([100,100,100])
wingr.setEuler([0,90,0])
wingr.collideSphere(0.5)
rStartPOS = [ 0, 2.5, 2 ]
wingr.setPosition( rStartPOS )
#viz.MainView.setPosition([0,2,-15])
hub = myo.Hub()
hub.set_locking_policy(myo.locking_policy.none)
hub.run(1000, Listener())
vizact.ontimer(0.01 ,updateMyo, [gy, gy2, gy3, wingl, orx, ory, orz, orw, or1x, or1y, or1z, or1w, wingr])
开发者ID:rhodesvr,项目名称:myo-march,代码行数:29,代码来源:myoTVDemo.py
示例3: main
def main():
global loc_list
global active_location
loc_list = []
mainSceneWindow = None
cameraWindow = None
cameraWindowView = None
cam = None
pause_screen = None
nunchuck_disconnect_screen = None
message_screen = None
wiimote = None
nunchuck_wiimote = None
should_it_run = None
mainSceneWindow, cameraWindow, cameraWindowView, cam, pause_screen, nunchuck_disconnect_screen, message_screen, wiimote, nunchuck_wiimote, should_it_run = init_settings(mainSceneWindow, cameraWindow, cameraWindowView, cam, pause_screen, nunchuck_disconnect_screen, message_screen, wiimote, nunchuck_wiimote, should_it_run)
vizact.ontimer(0, moveCamera, nunchuck_wiimote, should_it_run)
viz.callback(wii.EXT_CONNECT_EVENT,onConnect)
viz.callback(wii.EXT_DISCONNECT_EVENT,onDisconnect)
initializer(loc_list)
arMarkerLoader(cam)
wiimoteInitializer(wiimote, nunchuck_wiimote, should_it_run, message_screen)
viz.go() # Inicia VIZ
for item in loc_list:
if item.space_name == "piazza.osgb":
active_location = item
item.addLocation()
开发者ID:luion,项目名称:virtual-ar-museum,代码行数:32,代码来源:universe.py
示例4: __init__
def __init__(self, targetNode):
self.control(targetNode)
vizact.ontimer(0,self.UpdateView)
vizact.onkeydown('t', self.resetPitch)
vizact.onkeydown('y', self.slower)
vizact.onkeydown('u', self.faster)
vizact.onkeydown('o', self.printEuler)
vizact.onkeydown('p', self.printPos)
开发者ID:vhilab,项目名称:VHIL-Module-Library,代码行数:8,代码来源:vhil_devkit.py
示例5: __init__
def __init__(self, targetNode):
self.control(targetNode)
vizact.ontimer(0, self.UpdateView)
vizact.onkeydown("t", self.resetPitch)
vizact.onkeydown("y", self.slower)
vizact.onkeydown("u", self.faster)
vizact.onkeydown("o", self.printEuler)
vizact.onkeydown("p", self.printPos)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:8,代码来源:vhil_devkit_Vive.py
示例6: main
def main():
global initialStep
# if initialStep:
time.sleep(3)
text1.setPosition(0,1.6,4)
print "START"
vizact.ontimer2(0.33, 2, getInitial)
vizact.ontimer(1/60, checkStep)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:8,代码来源:TwoKinects.py
示例7: 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
示例8: setAsMain
def setAsMain(self):
viz.logStatus('Setting Joyculus as main')
val = mathlite.getNewRange(self.joy.getSlider(),1,-1,self.MIN_SPEED,self.MAX_SPEED)
self.MOVE_SPEED = val
vizact.onsensordown(self.joy,self.KEYS['reset'],self.reset)
vizact.ontimer(0,self.updateView)
viz.callback(getExtension().SLIDER_EVENT,self.onSliderChange)
开发者ID:justlim77,项目名称:TrussBridgeBuilder,代码行数:9,代码来源:navigation.py
示例9: initialize
def initialize():
global controller
# Create a sample listener and controller
# listener = SampleListener()
controller = Leap.Controller()
# Have the sample listener receive events from the controller
# controller.add_listener(listener)
vizact.ontimer(0.01, getLeapData)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:10,代码来源:leap_stuff.py
示例10: addStreetlights
def addStreetlights(scene=viz.MainScene):
global timeToMove, streetLight, origPOS, endPOS
timeToMove = 1.2
origPOS = [ [8, 2.5, 5] , [8,2.5,-5] ]
endPOS = [ [-11,2.5,5] , [-11,2.5,-5] ]
streetLight = vizfx.addPointLight()
streetLight.intensity(.4)
streetLight.color(viz.WHITE)
moveStreetlight()
vizact.ontimer(timeToMove+1, moveStreetlight)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:10,代码来源:StreetlightBusEffect.py
示例11: __init__
def __init__(self, node=None, scene=viz.Scene1):
self.scene = scene
self.node = node
self.found = []
self.returnPosition = True
self.returnEuler = True
self.returnCurrent = True
self.selected = None
self.enabled = False
vizact.ontimer(.1, self.cursorChange)
vizact.onmousedown(viz.MOUSEBUTTON_LEFT, self.computeDistance)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:11,代码来源:DistanceFinder.py
示例12: main
def main():
global co2models, moleculeManager,overOceanSensor
loadBoatScene()
#terrain_LW = vizfx.addChild(('./art/ENV_Island_Main.osgb').getChild('Ocean001'))
setUpMolecAnimation()
# viz.MainScene.enable(viz.FOG, op=viz.OP_ROOT)
vizact.ontimer(0, masterTimer)
overOceanSensor = vizproximity.addBoundingBoxSensor(globals_oa.boat, scale = [.8,.8,.65])
moleculeManager.addSensor(overOceanSensor)
initializeBoatGrabberAndPhysics()
setUpHandSensors()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:11,代码来源:MoleculeGrabbingHandTarget.py
示例13: addSirens
def addSirens(scene=viz.MainScene):
redSiren = makeSiren(scene=scene)
redSiren.color(viz.RED)
redSiren.position(0.93, 1.43, -1.98, 1)
blueSiren = makeSiren(scene=scene)
blueSiren.color(viz.BLUE)
blueSiren.position(-0.5, 1.43, -1.98, 1)
global sirenAudio
sirenAudio = redSiren.playsound("resources/audio/PoliceSiren.wav")
vizact.ontimer(0.1, moveSirens, redSiren, blueSiren)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:12,代码来源:PoliceNarrative.py
示例14: main
def main():
global masterTimerG, recordingTimer
setUp()
masterTimerG = vizact.ontimer(0, masterTimer)
#recordingTimer = vizact.ontimer(0, recordCurrentSubjectStatus)
if not KEYBOARD_NAVIGATE:
addKeyPresses()
else:
# Setup keyboard/mouse tracker
tracker = vizcam.addWalkNavigate(moveScale=10.0)
tracker.setPosition([0,1.8,0])
viz.link(tracker,viz.MainView)
viz.mouse.setVisible(False)
def printLocation():
print viz.MainView.getPosition(), viz.MainView.getEuler()
vizact.onkeydown('p', printLocation)
#Add Wiimote support
# wii = viz.add('wiimote.dle')
# #Connect to first available wiimote
# wiimote = wii.addWiimote()
# wiimote.led = wii.LED_4
# #Add button functions
# vizact.onsensordown(wiimote,wii.BUTTON_A,TurnFlyingOn)
# vizact.onsensordown(wiimote,wii.BUTTON_B,TurnFlyingOff)
# vizact.onsensordown(wiimote,wii.BUTTON_1,endChildHappy)
#
#Hacky bug fix below, I apologize -Mark
if not FLYING_F and YOKE_F:
viztask.schedule(fixStartHeliPos)
开发者ID:vhilab,项目名称:Demos,代码行数:32,代码来源:Flying_Demo_2015.py
示例15: __init__
def __init__(self, fig):
self.canvasData = viz.Data(lock = threading.Lock(), havenewData=False )
self.fig = fig
self.t = threading.Thread(target=self.computeFigureThread)
self.t.start()
#IMPORTANT: Wait for thread to finish before exiting
vizact.onexit(self.t.join)
#Create a blank texture to display canvas data
self.tex = viz.addBlankTexture([1,1])
#Create onscreen quad to display texture
self.quad = viz.addTexQuad(parent=viz.ORTHO,texture=self.tex)
self.quad.alpha(0.5)
self.link = viz.link(viz.MainWindow.CenterCenter,self.quad)
# self.link.setOffset([400,200,0])
self.drawer = vizact.ontimer(0, self.drawPlot)
self.rate_ctr = time.time()
self.drawrate_txt = viz.addText('', viz.SCREEN)
self.drawrate_txt.setPosition(0,0.01)
self.drawrate_txt.scale(.7,.7)
self.drawrate_txt.color(viz.WHITE)
self.drawrate_txt.visible(0)
self.rate = 0
#scale variables to change size of plot image
self.scale_x = 1
self.scale_y = 1
开发者ID:awellis,项目名称:SVV,代码行数:26,代码来源:vizmatplot.py
示例16: InitHMD
def InitHMD():
global collisionLimbBoxes
if(USE_HMD):
pptExtension.setup();
viz.go(viz.FULLSCREEN)
viz.clip(0.1)
vizact.onupdate(0, pptExtension.pptUpdate, avatar, ghostAvatar, collisionLimbBoxes);
if(len(collisionLimbBoxes) > 0):
vizact.ontimer(1, pptExtension.refreshAvatar, ghostAvatar, avatar, collisionLimbBoxes);
else:
vizact.ontimer(1, pptExtension.refreshAvatar, ghostAvatar, avatar, None);
else:
pptSimulation.setup(avatar);
viz.clip(0.1)
viz.go(viz.FULLSCREEN);
vizact.onupdate(0, pptSimulation.pptUpdate, avatar, ghostAvatar, collisionLimbBoxes);
开发者ID:vhilab,项目名称:thirdArm,代码行数:16,代码来源:MirrorTouchCubes2.py
示例17: __init__
def __init__(self):
self.targetNumber = 3
self.maxNum = 7
self.buffSize = 7
self.updateRateSecs = 0.75
self.nextBuffer = np.array([])
self.lastBuffer = []
while(self.nextBuffer.size < self.buffSize):
self.addInt()
self.textObj = viz.addText('',parent=viz.SCREEN)
self.textObj.setPosition(0.5,0.5)
self.textObj.color(viz.WHITE)
self.textObj.alignment( viz.ALIGN_CENTER_CENTER)
self.textObj.fontSize(1000)
self.targetTimer = []
self.updateAction = vizact.ontimer(self.updateRateSecs,self.presentNumber)
self.stopPresentingNumbers()
print 'Ready. To start countdown, run <numberCount>.startPresentingNumbers()'
开发者ID:performlabrit,项目名称:NumberDetectionTask,代码行数:27,代码来源:numberTask.py
示例18: skipBackward
def skipBackward(self):
self.skipAmount -= 1
if self.skipAmount == 0: # Was skipping forward, now is 0
self.skipTimer.remove()
elif self.skipAmount == -1: # Was at 0, now is skipping backward
self.pause()
self.skipTimer = vizact.ontimer(SKIP_PERIOD, self._skip)
print 'skipping backward ' + str(self.skipAmount) + ' seconds per frame.'
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:8,代码来源:spherical_player_Vive.py
示例19: fadeOutTask
def fadeOutTask(self, fadeTime=1.5):
"""Yieldable task to fade out to silent"""
initialVolume = self._mixer.getVolume()
amount = - initialVolume * (self._timeStep / fadeTime)
self.updateEvent = vizact.ontimer(self._timeStep, self._updateFadeOut, amount)
yield viztask.waitEvent(FADE_COMPLETE)
self.updateEvent.setEnabled(False)
self._mixer.stop()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:8,代码来源:Audio_Fader.py
示例20: InitHMD
def InitHMD():
#BL:start
global collisionLimbBoxes
# if USE_HMD:
pptextension.setup()
if some_global_variables.headTrackingActive:
viz.go(viz.HMD | viz.TRACKER)
else:
viz.go()
viz.window.setSize(1260, 950)
#viz.go(viz.FULLSCREEN)
#BL:end
viz.clip(0.1)
vizact.onupdate(0, pptextension.pptUpdate, some_global_variables.avatar, some_global_variables.ghostAvatar, collisionLimbBoxes);
if(len(collisionLimbBoxes) > 0):
vizact.ontimer(1, pptextension.refreshAvatar, some_global_variables.ghostAvatar, some_global_variables.avatar, collisionLimbBoxes);
else:
vizact.ontimer(1, pptextension.refreshAvatar, some_global_variables.ghostAvatar, some_global_variables.avatar, None);
开发者ID:vhilab,项目名称:fiveArms,代码行数:18,代码来源:fiveArms.py
注:本文中的vizact.ontimer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论