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

Python viz.addText函数代码示例

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

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



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

示例1: __init__

	def __init__(self):
		#init canvas and create themes for the test panel
		self.canvas = viz.addGUICanvas(align = viz.ALIGN_CENTER_CENTER)
		self.canvas.setPosition(0,0,0)
		viz.mouse.setVisible(False)
		self.name = 'test'
		self._theme = viz.Theme()
		self._theme.borderColor = (0.1,0.1,0.1,1)
		self._theme.backColor = (0.4,0.4,0.4,1)
		self._theme.lightBackColor = (0.6,0.6,0.6,1)
		self._theme.darkBackColor = (0.2,0.2,0.2,1)
		self._theme.highBackColor = (0.2,0.2,0.2,1)
		self._theme.textColor = (1,1,1,1)
		self._theme.highTextColor = (1,1,1,1)
		
		#initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER_TOP, fontSize = 15)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		self.alpha(0.6)
		
#		#title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		#bones to be snapped. source snapped to target.
		source = 'a'*20
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		target = 'a'*20
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		#instructions 
		self.Instruct1 = self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand = self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2 = self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand = self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		#render canvas
		
		if config.dispMode == config.DisplayMode.monitor:
			self.canvas.billboard(viz.BILLBOARD_YAXIS)
			self.canvas.setPosition(-2,0,0)
			self.canvas.setBackdrop(viz.ALIGN_CENTER_TOP)
			

		if config.dispMode == config.DisplayMode.oculus:

			bb = self.canvas.getBoundingBox()
			self.canvas.setRenderWorldOverlay([bb.width*1, bb.height*1], fov = bb.height, distance = 0.4)
			self.canvas.setPosition(0,0.05,0)
			self.canvasViewPos = self.canvas.getPosition()
			self.canvas.setEuler(0,15,0)
			self.canvas.setPosition(0, -5, 0)
			self.canvasHidePos = self.canvas.getPosition()
			viztask.schedule(self.updatePanelPos())
			
		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:59,代码来源:view.py


示例2: ShowTotalScore

	def ShowTotalScore (self):
		#add third row with the total score if not added already
		try:
			self._total.alignment(viz.ALIGN_RIGHT_BASE)
		except:
			row3text = viz.addText(self.tooltips['score'])
			row3text.font("Segoe UI")
			row3icon = viz.addTexQuad(size=25, texture=viz.add('textures/total_icon.png'))
			self._total= viz.addText('000')
			self._total.font("Segoe UI")
			self._total.alignment(viz.ALIGN_RIGHT_BASE)
			self._scorePanel.addRow([row3icon, row3text, self._total])
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:12,代码来源:Window.py


示例3: __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


示例4: displayInputPanel

def displayInputPanel():
	global inputPanel, names
	
	inputPanel = viz.addGUIGroup()
#	endG = viz.addGroup(viz.SCREEN)
	splashScreen = viz.addTexQuad(parent=viz.SCREEN,pos=[0.5,0.5,0],scale=[13,10.5,1])
	splashScreen.texture(viz.addTexture('textures/splash_screen'+LANG+'.jpg'))
	splashScreen.setParent(inputPanel)
	names = []
	pl = range(condition%2*2+1)
	pl.reverse()
	for i,p in enumerate(pl):
		name = viz.addTextbox()
		nameText = {'':'Player %s name:', 'GR':'Όνομα παίκτη %s:'}
		title = viz.addText(nameText[LANG]%str(i+1), viz.SCREEN)
		title.fontSize(24)
		title.addParent(inputPanel)
		title.setPosition([.4, .53+.1*p, 0])
		name.setPosition([.5, .5+.1*p, 0])
		name.addParent(inputPanel)
		names.append(name)
	startB = viz.addButtonLabel('START')
	startB.setPosition(.5,.4)
	startB.addParent(inputPanel)
	vizact.onbuttonup(startB, initialize)
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:25,代码来源:OLiVE.py


示例5: strippedTrialTask

def strippedTrialTask(avatar, turningAngle, vLinear, tLegs, idxTrial, output = {}):
	"""
	master task that invokes all other tasks as subtasks to ensure right order
	"""
	# add text for instructions
	screenText = viz.addText('trial no. '+str(idxTrial),viz.SCREEN)
	screenText.setBackdrop(viz.BACKDROP_RIGHT_BOTTOM)
	screenText.setBackdropColor(viz.GRAY)
	screenText.setPosition(0.05, 0.5)
	
	# wait for key press and execute trial
	yield viztask.waitKeyDown(' ')
	screenText.message('')
	passage = passageAction(turningAngle, vLinear, tLegs)
	avatar.addAction(passage)
	yield viztask.waitActionEnd(avatar, passage)
	
	# get homing vectors
	yield helperFunctions.saveHomingVectors(avatar, output)
	print output
	
	# post trial instructions & position reset
	yield viztask.waitTime(0.2)
	screenText.message('please select your\nanswer for trial '+str(idxTrial))
	yield viztask.waitKeyDown(' ')
	screenText.remove()
	yield helperFunctions.resetTask(avatar)
开发者ID:leftbigtoe,项目名称:starfield,代码行数:27,代码来源:classroomTrials.py


示例6: __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


示例7: loadStuff

def loadStuff():
	globals_oa.loadScavengerHuntAssetsCalled = True
#	
	globals_oa.basket = vizfx.addChild(EQUIPMENT_DIRECTORY + 'diveBasketslate.osgb')
	#globals_oa.basket = vizfx.addChild(EQUIPMENT_DIRECTORY + 'diveBasket.osgb')
	#globals_oa.basket.setScale([0.75, 0.85, 0.75]) old basket scale, no shelf
	globals_oa.basket.setScale([0.65, 0.75, 0.65])
	globals_oa.basket.billboard(viz.BILLBOARD_YAXIS)
	globals_oa.slate = globals_oa.basket.getChild('Slate_New.OSGB')
#	globals_oa.slate = vizfx.addChild(EQUIPMENT_DIRECTORY + 'Slate_New.osgb')
#	globals_oa.slate.visible(False)
	
	global pics
	pics = []
	pics.append( viz.addTexture('resources/Ocinebrina Edwardsii_Zone' + str(globals_oa.currentZoneNumber) + '.png') )
	pics.append( viz.addTexture('resources/Octopus_2D.png') )
	pics.append( viz.addTexture('resources/Eel_2D.png') )
	pics.append( viz.addTexture('resources/seagrass.jpg') ) # Get picture of seagrass
	
	global time_text
	time_text = viz.addText3D('', pos = [0, 0, 0])
	time_text.visible(False)
	
	global count_text1
	global count_text2
	global count_text3
	global quad1
	global quad2
	global quad3
	
	quad1 = viz.addTexQuad(size = 0.15)
	quad2 = viz.addTexQuad(size = 0.15)
	quad3 = viz.addTexQuad(size = 0.15)
	count_text1 = viz.addText('found: 0')
	count_text2 = viz.addText('found: 0')
	count_text3 = viz.addText('found: 0')
	
#	quad1.disable(viz.LIGHTING)
#	quad2.disable(viz.LIGHTING)
#	quad3.disable(viz.LIGHTING)
	quad1.disable(viz.FOG)
	quad2.disable(viz.FOG)
	quad3.disable(viz.FOG)
	
	hideBasketAndStuffAttachedToIt()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:45,代码来源:scavengerhunt.py


示例8: __init__

	def __init__(self, canvas, controller):
		super(ModeMenu, self).__init__(canvas, 'mode', 'Mode Selection')
		
		# Store controller instance
		self.controller = controller
		
		#Store modes from config to populate modemenu with
		self.modes = config.MenuConfig.Modes
		self.getPanel().fontSize(50)
		
		##########################
		"""creating modes panel"""
		##########################
		
		#creating labels for modes
		self.modeLabels = {}
		
		for l in self.modes.iterkeys():
			self.modeLabels[l] = viz.addText(l, parent = canvas)
		
		#creating radio buttons for modes
		self.modeGroup = viz.addGroup(parent = canvas)
		self.radioButtons = {}
		
		for rb in self.modes.iterkeys():
			self.radioButtons[rb] = viz.addRadioButton(self.modeGroup, parent = canvas)
		
		self.radioButtons['Free Play'].set(1)
		
		#creating grid panel to add mode to
		modeGrid = vizdlg.GridPanel(parent = canvas)
		
		#adding modes and radio buttons to grid panel
		for i in self.modes.iterkeys():
			modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])
		
		##############################
		"""next and back buttons"""
		##############################
		
		#creating grid panels to add next and back buttons to
		setGrid = vizdlg.GridPanel(parent = canvas)
		
		#create back and next buttons and add to grid panel
		backButton = viz.addButtonLabel('Back')
		startButton = viz.addButtonLabel('Next')
		setGrid.addRow([backButton, startButton])
		
		#add back and state button actions
		self.backward = vizact.onbuttondown(backButton, self.controller.backMenu)
		self.forward = vizact.onbuttondown(startButton, self.controller.nextMenu)
		
		###############################
		"""add items to ModeMenu"""
		###############################
		self.addItem(modeGrid)
		self.addItem(setGrid)
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:57,代码来源:menu.py


示例9: __init__

	def __init__(self):
		"""Init canvas and create themes for the test panel"""
		self.canvas = viz.addGUICanvas(parent = viz.ABS_GLOBAL)
		viz.mouse.setVisible(False)
		self.name = 'test'
		
		self._theme					= viz.Theme()
		self._theme.borderColor		= (0.1,0.1,0.1,1)
		self._theme.backColor		= (0.4,0.4,0.4,1)
		self._theme.lightBackColor	= (0.6,0.6,0.6,1)
		self._theme.darkBackColor	= (0.2,0.2,0.2,1)
		self._theme.highBackColor	= (0.2,0.2,0.2,1)
		self._theme.textColor		= (1,1,1,1)
		self._theme.highTextColor	= (1,1,1,1)
		
		# Initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER, fontSize = 10)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		
		# Title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		# Bones to be snapped. source snapped to target.
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		# Instructions 
		self.Instruct1		= self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand	= self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2		= self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand	= self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		# Render canvas
		bb = self.getBoundingBox()
		self.canvas.setRenderWorld([bb.height, bb.width],[4, 3*1.333])
		
		# On esc toggle menu (doesn't interfere with in-game menu)
#		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
		self.canvas.setPosition(0.0,2.0,4.0)
		self.canvas.resolution(self.canvas.getResolution())
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:44,代码来源:puzzleView.py


示例10: CreateScorePanel

	def CreateScorePanel(self):
		self._newScore = None	#holds the temp score after each update
		self._scorePanel = vizdlg.GridPanel(window=self._window, skin=vizdlg.ModernSkin, 
					spacing=-10, align=vizdlg.ALIGN_RIGHT_TOP, margin=0)
		row1text = viz.addText(self.tooltips['points'])
		row1text.font("Segoe UI")
		self._scoreIcon = viz.addTexQuad(size=25, texture=viz.add('textures/star_yellow_256.png'))
		self._score= viz.addText('000')
		self._score.font("Segoe UI")
		self._score.alignment(viz.ALIGN_RIGHT_BASE)
		self._scorePanel.addRow([self._scoreIcon, row1text, self._score])
		row2text = viz.addText(self.tooltips['oil'])
		row2text.font("Segoe UI")
		self._oilIcon = viz.addTexQuad(size=25, texture=viz.add('textures/oil_icon.png'))
		self._oil= viz.addText('000')
		self._oil.font("Segoe UI")
		self._oil.alignment(viz.ALIGN_RIGHT_BASE)
		self._scorePanel.addRow([self._oilIcon, row2text, self._oil])
		self._scorePanel.setCellAlignment(vizdlg.ALIGN_RIGHT_TOP)
		#place the score board at the top right corner of the window
		viz.link(self._window.RightTop, self._scorePanel, offset=(-10,-45,0))
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:21,代码来源:Window.py


示例11: AddPanel

	def AddPanel(self, langu):
		self._hud = viz.addGroup(viz.ORTHO, scene=self._window)
		panel = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=200)
		panel.texture(viz.addTexture('textures/panel.png', useCache = True))
		panel.setParent(self._hud)
		self.tag = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=200)
		self.tag.texture(viz.addTexture('textures/p'+str(self._player)+'_tag.png', useCache = True))
		self.tag.setParent(self._hud)
		#add the player name as a child of the panel
		self._name = viz.addText(self._name, panel)
		self._name.alignment(viz.ALIGN_CENTER_TOP)
		self._name.font("Segoe UI")
		self._name.color(viz.BLACK)
		self._name.fontSize(14)
		self._name.resolution(.5)
		self._name.setScale(1.5,.75,1)
		self._name.setPosition(3,92,0)
		self._name.setParent(self._hud)
		#add the user feedback message
		self._message = viz.addText('', viz.ORTHO, self._window)
		self._message.alignment(viz.ALIGN_LEFT_TOP)
		self._message.font("Segoe UI")
		self._message.color(viz.BLACK)
		self._message.fontSize(13)
		self._message.resolution(.5)
		self._message.setScale(1.5,.75,1)
		self._message.setPosition(-80,32,0)
		self._message.setParent(self._hud)
		#add the collab icon
		self._collabTextures = [viz.add('textures/signs'+langu+'/collab0.png'), viz.add('textures/signs'+langu+'/collab1.png')]
		self._collabIcon = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=150)
		self._collabIcon.texture(self._collabTextures[0])
		self._collabIcon.setParent(self._hud)
		self._collabIcon.drawOrder(20)
		self._collabIcon.setPosition(0, -65, 10)
		self._collabIcon.setScale(1,.4,1)
		self._collabIcon.alpha(0)
		self.ResizePanel()
		#add the info panels
		self.CreateInfoPanels()
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:40,代码来源:Window.py


示例12: __init__

	def __init__(self):
#		self.statsPanel = vizinfo.InfoPanel(title='Inspector',text=None,align=viz.ALIGN_CENTER_BASE,icon=False)
#		self.statsPanel.getTitleBar().fontSize(16)
#		self.diameter_stat = viz.addText('d (mm)')
#		self.statsPanel.addItem(self.diameter_stat)
#		self.thickness_stat = viz.addText('t (mm)')
#		self.statsPanel.addItem(self.thickness_stat)
#		self.length_stat = viz.addText('l (m)')
#		self.statsPanel.addItem(self.length_stat)
#		self.rotation_stat = viz.addText('angle')
#		self.statsPanel.addItem(self.rotation_stat)
		
		self.statsPanel = vizdlg.Panel(align=viz.ALIGN_CENTER_TOP,border=False)
		self.statsMsg = self.statsPanel.addItem(viz.addText('Highlight member to inspect element'))
开发者ID:justlim77,项目名称:TrussBridgeBuilder,代码行数:14,代码来源:panels.py


示例13: multipleTrialTask

def multipleTrialTask(avatar, angles):
	"""
	function to call multiple trials (needs to be a task to ensure proper time course)
	"""
	counter = 1
	for angle in trialDict['turningAngles']:
		output = {}
		yield viztask.waitTask(strippedTrialTask(avatar, angle, trialDict['vLinear'], 
												 trialDict['tLegs'], counter))
		counter+=1
	# add text for instructions
	screenText = viz.addText('please open and fill out\nthe questionnaires now',viz.SCREEN)
	screenText.setBackdrop(viz.BACKDROP_RIGHT_BOTTOM)
	screenText.setBackdropColor(viz.GRAY)
	screenText.setPosition(0.05, 0.5)
开发者ID:leftbigtoe,项目名称:starfield,代码行数:15,代码来源:classroomTrials.py


示例14: BlendEffect

flash_quad.drawOrder(-10)
flash_quad.blendFunc(viz.GL_ONE,viz.GL_ONE)
flash_quad.visible(False)
viz.link(viz.MainWindow.WindowSize,flash_quad,mask=viz.LINK_SCALE)

# Create status bar background
status_bar = viz.addTexQuad(parent=viz.ORTHO)
status_bar.color(viz.BLACK)
status_bar.alpha(0.5)
status_bar.alignment(viz.ALIGN_LEFT_BOTTOM)
status_bar.drawOrder(-1)
viz.link(viz.MainWindow.LeftTop,status_bar,offset=[0,-80,0])
viz.link(viz.MainWindow.WindowSize,status_bar,mask=viz.LINK_SCALE)

# Create time limit text
time_text = viz.addText('',parent=viz.ORTHO,fontSize=40)
time_text.alignment(viz.ALIGN_CENTER_TOP)
time_text.setBackdrop(viz.BACKDROP_OUTLINE)
viz.link(viz.MainWindow.CenterTop,time_text,offset=[0,-20,0])

# Create score text
score_text = viz.addText('',parent=viz.ORTHO,fontSize=40)
score_text.alignment(viz.ALIGN_LEFT_TOP)
score_text.setBackdrop(viz.BACKDROP_OUTLINE)
viz.link(viz.MainWindow.LeftTop,score_text,offset=[20,-20,0])

# Create post process effect for blending to gray scale
gray_effect = BlendEffect(None,GrayscaleEffect(),blend=0.0)
gray_effect.setEnabled(False)
vizfx.postprocess.addEffect(gray_effect)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:30,代码来源:D2C3.py


示例15: camera

yaw = 0
yawB = 0
yaws = []
yawsB = []
aveYaw = 0
aveYawB = 0
quadrant = 0 # 0,1,2,3
flag_out = 0 # turn on when camera A can't detect yaw
flag_outB = 0 #turn on when camera B can't detect yaw
flag_clockwise = 0
flag_side_cam = 0 #turn on when using side camera (B)
YAW_SIZE = 20
finalYaw = 0
finalYaws = []
aveFinalYaw = 0
text1 = viz.addText("Start walking")

stepCount = 0
mainYaw = 0
output2file = 1
now = datetime.datetime.now()
counter = 0
filename = '../bin/Output files/output {}-{} {},{},{}.csv'.format(now.month,now.day,now.hour,now.minute,now.second)
''' ********************* End of Initializations ************************ '''


def setDown():
	global prevStep
	prevStep = "DOWN"
	viz.MainView.velocity(0,0,0)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:30,代码来源:2kinectsHMD.py


示例16: addValue

	def addValue(self, days, money):
		cost = viz.addText(str(money))
		label = self.menu.addLabelItem('Days left: ' + str(days) + " | " + 'Amount of money needed: ', cost)
		self.labels.append(label)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:4,代码来源:CounterGUI.py


示例17:

HistBallR.setPosition([rxdistance,0,Rdistance])
HistBallR.setEuler(180,0,0)
HistBallR.alpha(0.8)

#Add an extra light so the left target looks almost as bright as the right one
newlight = viz.addLight();
newlight.setPosition([-1,0,0.25])
newlight.intensity(1.5)

#setup counter panels
global RCOUNT
global LCOUNT
RCOUNT = 0
LCOUNT = 0
#rightcounter = vizinfo.InfoPanel(str(RCOUNT),align=viz.ALIGN_RIGHT_TOP,fontSize=50,icon=False,key=None)
rightcounter = viz.addText(str(RCOUNT),pos=[.4,-0.25,1],scale=[0.1,0.1,0.1])
#leftcounter = vizinfo.InfoPanel(str(LCOUNT),align=viz.ALIGN_LEFT_TOP,fontSize=50,icon=False,key=None)
leftcounter = viz.addText(str(LCOUNT),pos=[-.46,-0.25,1],scale=[0.1,0.1,0.1])

global RGOB
RGOB = 0 #this will be 0 or 1, depending on success or failure
global LGOB
LGOB = 0
global stepind #this keeps track of the total # of attempts
stepind = 0

global RightBeltSpeed
global LeftBeltSpeed
RightBeltSpeed = 0
LeftBeltSpeed = 0
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:30,代码来源:BFback_steplength_static_v3_rev9_FIT.py


示例18: initialize


#.........这里部分代码省略.........
		quad3.visible(False)
		count_text3.visible(False)


	# Create surface to wrap the texture on 
#	global quad
#	if quad is None:
#		quad = viz.addTexQuad(size = 0.25) 
#		quad.setTexQuadDisplayMode(viz.TEXQUAD_FIT)
#		quad.setParent(globals_oa.slate)
#		quad.setPosition([0,0.01,0])
#		quad.setEuler([180,-90,0])
#		quad.setScale([0.5,0.5,0.5])
#		# Wrap texture on quad 
#		display_image_link = viz.link(globals_oa.slate, quad)# offset = (0.0, 0.01, 0.25))
#		#display_image_link = viz.addTexQuad(texture=viz.add('resources/Ocinebrina Edwardsii.tif'), size=0.1)
#		#display_image_link.setMask(viz.LINK_POS)
#		display_image_link.setEuler([None,90,0], 1)
#		display_image_link.preTrans([0.0, 0.01, 0.25], 0)
#		#quad.setEuler([0, 90, 0], mode = viz.REL_LOCAL)
#		quad.disable(viz.INTERSECTION)
#		quad.disable(viz.LIGHTING)
#		quad.disable(viz.FOG)
	else:
		quad.visible(True)

	
	
	textPos = [0, -0.05, 1]
	speciesTextScale = 0.05
	global speciesText
	if speciesText is None:
		if hud is not None:
			speciesText = viz.addText("", pos=textPos, parent=hud)
			speciesText.alignment(viz.ALIGN_CENTER_TOP)
			speciesText.setScale(speciesTextScale, speciesTextScale, speciesTextScale)
			speciesText.color(viz.BLACK)
			speciesText.visible(False)

	#viz.callback(viz.TIMER_EVENT,onTimer) 

	if (((globals_oa.currentZoneNumber == 0) and globals_oa.scavengerHuntCompleteInTestZone) or ((globals_oa.currentZoneNumber == 1) and globals_oa.scavengerHuntCompleteInZone1) or 
	((globals_oa.currentZoneNumber == 2) and globals_oa.scavengerHuntCompleteInZone2) or ((globals_oa.currentZoneNumber == 3) and globals_oa.scavengerHuntCompleteInZone3)):
		print "This scavenger hunt is already completed! Please try the hunt in a different zone."
		return

	print 'Scavenger Hunt started'
	global scavengerHuntStartSound
	if scavengerHuntStartSound is None:
		scavengerHuntStartSound = loadAudioFile(AUDIO_DIRECTORY + 'bell.wav')
	
	#adding a manager for touching the snails
	global snailTouchManager
	snailTouchManager = vizproximity.Manager()
#	snailTouchManager.setDebug(viz.ON)
	vizact.onkeydown('k',snailTouchManager.setDebug,viz.TOGGLE)
	
	#adding sensor for the flag pile
	global flagPileManager
	flagPileSensor = vizproximity.Sensor(vizproximity.Sphere(.3,center=[1.3, -1.23484, 0.8]), source=flagPile)
	flagPileManager = vizproximity.Manager()
	flagPileManager.addSensor(flagPileSensor)
	vizact.onkeydown(';', flagPileManager.setDebug, viz.TOGGLE)

	
	#scavengerHuntStartSound.play()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:67,代码来源:scavengerhunt.py


示例19: attempt

global targetAmean
targetAmean = (targetAr+targetAl)/2

global targetXmean # X target, CJS 12/17/2016
targetXmean = (targetXXr+targetXXl)/2

global targettol
targettol = 0.0375

global reftime
reftime=time.time()

global messagewin
#messagewin = vizinfo.InfoPanel('',align=viz.ALIGN_CENTER_TOP,fontSize=60,icon=False,key=None)
#messagewin = viz.addText(str(0),pos=[0.05,targetXmean+0.2,0],scale=[0.05,0.05,0.05])
messagewin = viz.addText(str(0),pos=[-0.05,targetXmean-0.2,0],scale=[0.05,0.05,0.05])
messagewin.visible(0)

global messagephase
#messagephase = viz.addText(str(0),pos=[0.05,targetXmean-0.32,0],scale=[0.05,0.05,0.05])
messagephase = viz.addText(str(0),pos=[-.11,0.3,0],scale=[0.05,0.05,0.05])
messagephase.visible(0)

global prompt4TwoChoice
#prompt4TwoChoice = viz.addText('Which Leg had a longer X?',pos=[-0.2,0.4,0],scale=[0.05,0.05,0.05])
prompt4TwoChoice = viz.addText('Which step was Longer?',pos=[-.2,0.4,0],scale=[0.05,0.05,0.05])
prompt4TwoChoice.visible(0)

#declare the total number of steps to attempt (this is the accumulation of steps total, i.e. 75 R and 75 L means 150 total attempts)
global STEPNUM
STEPNUM =10
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:31,代码来源:PSYCHO+_X_TwoChoice_V4_Famililarization.py


示例20: range

#fakebox.color(0,1,0)
#fakebox.disable(viz.LIGHTING)

#create latitudinal grid, "10" is the target step length, the grid expands above and belo
lines = {}#create empty dictionary
for x in range(1,12,1):
	lines["Tp{0}".format(x)]=vizshape.addBox(size=[1,0.002,0.001])
	lines["Tp{0}".format(x)].setPosition(0,targetmean+0.05*targetmean+(x-1)*0.1*targetmean,0)#each gap represents 20 percent of target?
	lines["Tn{0}".format(x)]=vizshape.addBox(size=[1,0.002,0.001])
	lines["Tn{0}".format(x)].setPosition(0,targetmean+0.05*targetmean-(x-1)*0.1*targetmean,0)
#	print((x-1)*0.02)
global tnums
tnums = {}
for x in range(0,21,1):
	if (x<10):
		tnums["Num{0}".format(x)]=viz.addText(str(x),pos=[0,targetmean-0.95*targetmean-0.1*targetmean+x*0.1*targetmean+0.005,0],scale=[0.015,0.015,0.015])
	else:
		tnums["Num{0}".format(x)]=viz.addText(str(x),pos=[-0.005,targetmean-0.95*targetmean-0.1*targetmean+x*0.1*targetmean+0.005,0],scale=[0.015,0.015,0.015])
	
viz.MainView.setPosition(0,targetmean+0.05*targetmean, -0.57)
viz.MainView.setEuler(0,0,0)

global histzR
histzR = -500
global histzL
histzL = -500

global rgorb
rgorb = 0
global lgorb
lgorb = 0
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:31,代码来源:Vazquez_Exp2B_V75_rev4_DK2.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python viz.callback函数代码示例发布时间:2022-05-26
下一篇:
Python viz.addTexQuad函数代码示例发布时间: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