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

Python viz.addTexQuad函数代码示例

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

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



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

示例1: placeMirror

def placeMirror():
	
	mirrorPos = [0, 1.5, -2];
	
	global wall, mirrorRight, mirrorLeft, mirrorPlane
	wall = viz.addTexQuad()
	wall.setPosition(0, 0, mirrorPos[2] - 0.02)
	wall.setScale(20, 20, 1)
	# Apply nice repeating brick texture
	wallmatrix = vizmat.Transform()
	wallmatrix.setScale(20, 20, 1)
	wall.texmat( wallmatrix )
	bricks = viz.addTexture('brick.jpg')
	bricks.wrap(viz.WRAP_T, viz.REPEAT)
	bricks.wrap(viz.WRAP_S, viz.REPEAT)
	wall.texture(bricks)
	
	mirrorPlane = vizshape.addPlane()
	mirrorPlane.setPosition(mirrorPos, viz.ABS_GLOBAL)
	mirrorPlane.setEuler(0, 90, 0)
	mirrorPlane.setScale(0.09, 1, 0.05)

	windowBox = mirrorPlane.getBoundingBox(mode = viz.ABS_GLOBAL)
	x0 = windowBox.xmin
	x1 = windowBox.xmax
	y0 = windowBox.ymin
	y1 = windowBox.ymax
	z = windowBox.zmax

	viz.startlayer(viz.QUADS)
	viz.texcoord(0,0)
	viz.vertex( x0  , y0 , z )
	viz.texcoord(0,1)
	viz.vertex( x0  , y1, z )
	viz.texcoord(1,1)
	viz.vertex( x1  , y1, z)
	viz.texcoord(1,0)
	viz.vertex( x1  , y0 , z)

	mirrorRight = viz.endlayer( )
	mirrorLeft = mirrorRight.copy()	

	#specify the matrix
	m = viz.Matrix()
	#Try moving the mirror
	#print "z: " + str(z);
	m.setPosition([0, 0, z])
	m.setEuler(0, 0, 0)

	#Apply mirror settings to mirror object
	mirrorPlane.alpha(0.0)
	addMirror(mirrorRight,m,viz.RIGHT_EYE)
	addMirror(mirrorLeft,m,viz.LEFT_EYE)
	
	# Add collision
	mirrorPlane.collideBox()
	
	wall.visible(viz.OFF)
	mirrorRight.visible(viz.OFF)
	mirrorLeft.visible(viz.OFF)
开发者ID:vhilab,项目名称:fiveArms,代码行数:60,代码来源:mirrorroom.py


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


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


示例4: load

def load(sceneRef=viz.MainScene):
	global SCENE, ENABLE_LANDSCAPE, car, call_screen
	SCENE = sceneRef
	
	car = vizfx.addChild("Car_Final.OSGB", scene=SCENE)
	car.scale([CAR_SCALE,CAR_SCALE,CAR_SCALE])
	
	pic = viz.addTexture('resources/images/phone_screen_mail.jpg', scene = SCENE)
	call_screen = viz.addTexQuad(scene = SCENE)
	call_screen.setPosition(.075,.8,-2.4)
	call_screen.setEuler(-180,22,0)
	call_screen.setScale(.06,.06,.06)
	call_screen.texture(pic)
	
	PosessionHunting.load(car, SCENE)
	
	head = viz.MainView.getHeadLight() 
	head.disable()
	
	light.addDirectionalLights(CAR_SCALE, SCENE)
	light.addFog(SCENE)
	

	addSphericalLandscape(ENABLE_LANDSCAPE, SCENE)

#	vizact.onkeydown('b',police.addSirens,SCENE)
#	vizact.onkeydown('l',police.moveFlashlightToCar,SCENE,POLICE_WALK_TIME)

	global dc
	dc = DataCollector(filePrefix='Data/CarSceneTracking_Participant', fileSuffix='.csv')
	dc.addMainviewTracker()
	dc.startCollecting()
开发者ID:vhilab,项目名称:homelessness-study,代码行数:32,代码来源:CarScene.py


示例5: ShowErrorOnMap

	def ShowErrorOnMap(self, machine, mPos, flag):
		if flag == 0:	#remove error if there is one for this machine
			if self._alerts.has_key(machine):
				self._alerts[machine].remove()
				del self._alerts[machine]
				del self._messages[machine]
		else:	#add or update the alert icon in every other case
			#aPos = self._window.worldToScreen(mPos)
			#newAlert = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=50, pos=aPos)
			#add new alert if there is NOT one already for this machine
			alertSymbols = {1:'a', 2:'w'}
			if not self._alerts.has_key(machine):
				self.SOUNDS['alert'].play()
				newAlert = viz.addTexQuad(size=1.25)
				newAlert.texture(self._alertIcons[alertSymbols[flag]])
				newAlert.renderOnlyToWindows([self._window])
				newAlert.setPosition(mPos[0], 0, mPos[2])
				newAlert.setEuler(0, 90, 0)
				self._alerts[machine] = newAlert
			else:	#update the machine error if an alert if already defined
				self._alerts[machine].texture(self._alertIcons[alertSymbols[flag]])
		#show or hide the alert panel depending on the current alerts
		self._alertPanel.setPanelVisible(len(self._alerts)>0)
		if len(self._alerts) == 0:
			self._alertPanel.setIconTexture(self._alertIcons['a'])
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:25,代码来源:Window.py


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


示例7: init_settings

def init_settings(mainSceneWindow, cameraWindow, cameraWindowView, cam, pause_screen, nunchuck_disconnect_screen, message_screen, wiimote, nunchuck_wiimote, should_it_run):
	viz.MainWindow.visible(viz.OFF) #Hago invisible la main window
	viz.setMultiSample(8) # FSAA de 8
	viz.fogcolor = viz.BLACK # Color de sombra = negro
	viz.fog(0.15) # Agrega sombra de tipo exponencial
	viz.collision(viz.ON) # Habilita colisiones en el mundo
	viz.phys.enable() # Habilita la fisica

	#Desabilita mouse
	viz.mouse.setOverride(viz.ON)

	#Mouse invisible
	viz.mouse.setVisible(viz.OFF)

	#Subventana que renderea viz.MainWindow
	mainSceneWindow = viz.addWindow()
	mainSceneWindow.setSize(0.7,1)
	mainSceneWindow.setPosition(0,1)
	mainSceneWindow.fov(40, 1.3) # Coloca el FOV de la ventana principal en la actual con los valores de default (40 grados verticales, 1.3 aspect ratio)

	#Creando una ventana y un punto de vista para la camara
	cameraWindow = viz.addWindow(pos =[.7,1],size=(0.4,1)) #Creando la ventana
	cameraWindowView = viz.addView() #Creando un viewpoint
	cameraWindowView.setScene(2) #Poniendo la nueva ventana en la escena 2
	cameraWindow.setView(cameraWindowView) #Ligando el viewpoint con la nueva ventana

	#Vincular camara web a plugin de AR
	cam = ar.addWebCamera(window=cameraWindow) #Agregando una camara en la ventada nueva

	# Configuracion de mensajes de la pantalla
	message_screen = viz.addTexQuad(parent=viz.SCREEN, pos=[0.5,0.5,1], scale=[12.80,10.24,1]) 
	pause_screen = viz.add("PAUSA.png")
	nunchuck_disconnect_screen = viz.add("NUNCHUCK_DISCONNECTED.png")
	message_screen.texture(pause_screen)
	message_screen.visible(viz.OFF) #Cuando should_it_run sea False, viz.ON es el valor a usar.

	# Conecta al primer wiimote disponible
	wiimote = wii.addWiimote()
	# Prende el LED 1 del wiimote
	wiimote.led = wii.LED_1
	# Obten el nunchuck del wiimote
	nunchuck_wiimote = wiimote.nunchuk 

	#Determines wheter the program should run or not.
	#It will run if the Nunchuck is connected; otherwise, it won't.
	should_it_run = True

	#Ensures that the program won't run without the NUNCHUCK plug'd in.
	if(wiimote.getExtension() == wii.EXT_NUNCHUK):
		should_it_run = True
	else:
		print "Please plug-in the Wii NUNCHUCK."
		message_screen.texture(nunchuck_disconnect_screen)
		message_screen.visible(viz.ON)
		should_it_run = False
	
	return mainSceneWindow, cameraWindow, cameraWindowView, cam, pause_screen, nunchuck_disconnect_screen, message_screen, wiimote, nunchuck_wiimote, should_it_run
开发者ID:luion,项目名称:virtual-ar-museum,代码行数:57,代码来源:universe.py


示例8: loadTexQuads

def loadTexQuads(num):
	if num == 2:
		globals_oa.CANVAS_QUAD = viz.addTexQuad(size=globals_oa.promptQuadSize, scene=viz.Scene2)
	else:
		globals_oa.CANVAS_QUAD = viz.addTexQuad(size=globals_oa.promptQuadSize)
	globals_oa.CANVAS_QUAD.drawOrder(10000)
	globals_oa.CANVAS_QUAD.disable(viz.DEPTH_TEST)
	globals_oa.CANVAS_QUAD.setPosition(globals_oa.promptQuadPos)
	globals_oa.CANVAS_QUAD_1_TEXTURE = viz.addTexture('resources/card_species.jpg')
	globals_oa.CANVAS_QUAD_1_TEXTURE.hint(viz.PRELOAD_HINT)
	globals_oa.CANVAS_QUAD_2_TEXTURE = viz.addTexture('resources/card_pickup.jpg')
	globals_oa.CANVAS_QUAD_2_TEXTURE.hint(viz.PRELOAD_HINT)
	globals_oa.CANVAS_QUAD_3_TEXTURE = viz.addTexture('resources/divebasketslate.jpg')
	globals_oa.CANVAS_QUAD_3_TEXTURE.hint(viz.PRELOAD_HINT)
	globals_oa.MOVIE_INSTRUCTION_QUAD = viz.addVideo('resources/swim_card.MOV')
	#globals_oa.MOVIE_INSTRUCTION_QUAD.hint(viz.PRELOAD_HINT)
	globals_oa.CANVAS_QUAD.disable(viz.FOG)
	globals_oa.CANVAS_QUAD.visible(False)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:18,代码来源:boatScene.py


示例9: AddMap

	def AddMap (self):
		self.flmap=viz.add('models/floor_map2.IVE')
#		self.flmap.texture(viz.addTexture('textures/map_view.png'),'',0)
		self.flmap.setPosition(0, .01, 0)
		#self.flmap.setScale(1, 1, 1.1)
		self.flmap.renderOnlyToWindows([self._window])
		self.bg = viz.addTexQuad(parent=viz.ORTHO, scene=self._window)
		self.CreateInfoPanels()
		self.CreateScorePanel()
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:9,代码来源:Window.py


示例10: nextRoundAnimation

def nextRoundAnimation():
	global nextRoundPlaque, nextRoundSound
	if nextRoundPlaque is None:
		nextRoundPlaque = viz.addTexQuad()
		nextRoundPlaque.texture(viz.addTexture('./Resources/Misc/confetti.jpg'))
		nextRoundSound = nextRoundPlaque.playsound('./Resources/Misc/partyHorn.wav', viz.STOP, volume=0.1)
		nextRoundPlaque.setPosition(NRP_POS)
		nextRoundPlaque.setEuler(180, 0, 0)
		nextRoundPlaque.visible(viz.OFF)
	nextRoundSound.play()
	viztask.schedule(_plaqueAni)
开发者ID:vhilab,项目名称:thirdArm,代码行数:11,代码来源:touchcube.py


示例11: __init__

	def __init__(self, factory, pos):
		self.object = factory.add('models/boiler.ive')
		self.hatch = (self.object.insertGroupBelow('HatchDoorL'), self.object.insertGroupBelow('HatchDoorR'))
		self.gauge = self.object.insertGroupBelow('velona')
		fire = viz.add('textures/fire.mov', loop=1, play=1)
		self.fire = viz.addTexQuad(texture=fire, pos=[.15,1.2,0], size=1.2, alpha=0)
		self.fire.setParent(self.object)
		self.fire.visible(0)
		self.object.setPosition(pos)
		self.getComponents()
		#this is called by the AddProximitySensors() of the main module
		self.proximityData = (vizproximity.RectangleArea([5,5]), self.object)
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:12,代码来源:Machinery.py


示例12: show

	def show(self):
		"""Turns on the grid, destroys any prior grid, and writes the current grid to file."""
		if not self.previousMatrix:
			self.previousMatrix = viz.MainView.getMatrix()
		
		self.state = viz.ON
		viz.MainView.reset(viz.HEAD_POS | viz.HEAD_ORI)
		
		if (self.grid):
			self.grid.remove()
		
		self.grid = viz.addGroup()
		
		m =  viz.MainWindow.getMatrix()

		horizOffset = math.tan(self.centerHorizAngle)*self.distance + self.offset[0]
		vertOffset = math.tan(self.centerVertAngle)*self.distance + self.offset[1]
		
		horizDelta = math.tan(self.horizAngle) * self.distance + self.dx
		vertDelta = math.tan(self.vertAngle) * self.distance + self.dy
		
		topLeftPos = [horizOffset - horizDelta * (self.numCols -1) / 2, vertOffset - vertDelta * (self.numRows - 1) / 2, self.distance]
		
		self.pos =  [[[0, 0, 0]] * self.numRows for k in range(self.numCols)]
		
		self.pos_screen_left = [[[0, 0, 0]] * self.numRows for k in range(self.numCols)]
		self.pos_screen_right = [[[0, 0, 0]] * self.numRows for k in range(self.numCols)]
		
		for i in range(0, self.numCols):
			for j in range(0, self.numRows):
				#print i,j
				self.pos[i][j] = [topLeftPos[0] + i * horizDelta, topLeftPos[1] + j * vertDelta, self.distance]
								
				pt = viz.MainWindow.worldToScreen(self.pos[i][j], eye=viz.LEFT_EYE)
				pt[2] = 0
				self.pos_screen_left[i][j] = pt
				#print pt

				
				pt = viz.MainWindow.worldToScreen(self.pos[i][j], eye=viz.RIGHT_EYE)
				pt[2] = 0
				self.pos_screen_right[i][j] = pt
				
				q = viz.addTexQuad(parent=self.grid)
				q.texture(self.cross_tex)
				q.setScale(self.stimScale, self.stimScale, 1)
				q.setPosition(self.pos[i][j])
				q.billboard() #Makes always visible to viewer
				
		#print self.pos
				
		self.writeoutSettings()
		self.writeCustomCalPoints()
开发者ID:YanjieGao,项目名称:ExperimentBase,代码行数:53,代码来源:EyeTrackerCalibrationNVIS_MT.py


示例13: 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


示例14: 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


示例15: 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


示例16: addAimer

def addAimer(imageFile='crosshair.png', size=.3, scene=viz.MainScene, incomingColor = viz.WHITE):
#	print 'ADD AIMER CALLED'
	global crosshair
	global crosshairLink
	
#	scene=viz.MainScene

	if vhil_devkit.hmd is not None:
		hud = vhil_devkit.hmd.getHUD()
		
		crosshairPos = [0.0, 0.0, 1.0]
		crosshairScale = 0.05
		crosshair = viz.addText3D("O", pos=crosshairPos, parent=hud)
		crosshairScale = 0.025
		crosshair.setScale(crosshairScale, crosshairScale, crosshairScale)
		crosshair.drawOrder(1000000)
		if incomingColor is viz.GREEN:
			crosshairScale = 0.05
			crosshair.setScale(crosshairScale, crosshairScale, crosshairScale)
			shift = -0.01
			crosshairPos = [shift, shift, 1.0]
			crosshair.setPosition(crosshairPos)
			crosshair.color(incomingColor)
		crosshair.disable(viz.INTERSECTION)
		crosshair.disable(viz.LIGHTING)
		crosshair.disable(viz.DEPTH_TEST)

#		crosshair = viz.addTexQuad(texture=viz.add(imageFile), size=size, scene=scene, parent=hud)
		crosshairLink = viz.link(viz.MainView, crosshair)
		crosshairLink.disable()
#		crosshairLink.preTrans([0,0,4])
#		crosshairLink.preTrans([0,0,1.0])
#		crosshair.disable(viz.INTERSECTION)
#		crosshair.disable(viz.LIGHTING)
#
#		# Appear above other nodes
#		crosshair.drawOrder(100)
#		crosshair.disable(viz.DEPTH_TEST)
		print "HERE"
	else:
		crosshair = viz.addTexQuad(texture=viz.add(imageFile), size=size, scene=scene)
		crosshairLink = viz.link(viz.MainView, crosshair)
		crosshairLink.preTrans([0,0,4])
		crosshair.disable(viz.INTERSECTION)
		crosshair.disable(viz.LIGHTING)

		# Appear above other nodes
		crosshair.drawOrder(100)
		crosshair.disable(viz.DEPTH_TEST)

	return crosshair, crosshairLink
开发者ID:vhilab,项目名称:homelessness-study,代码行数:51,代码来源:AimCenterScreen.py


示例17: __init__

    def __init__(self, IDsToSelect, mouse=False, scene=viz.Scene1, audio="Audio/ChaChingSound.wav"):
        self.scene = scene
        viz.MainWindow.setScene(scene)
        self.selectables = IDsToSelect
        self.crosshair = viz.addTexQuad(
            viz.ORTHO, texture=viz.add("crosshair.png"), size=64
        )  # TODO: Does this work for Rift?
        crosshairLink = viz.link(viz.CenterCenter, self.crosshair)

        self.foundObj = None
        self.fadetime = 1
        self.delay = 1.5
        self.timer = vizact.ontimer(0.1, self.sellObject)
        self.mouse = mouse
        self.audio = audio

        self.disable()
开发者ID:vhilab,项目名称:homelessness-study,代码行数:17,代码来源:ObjectSelection.py


示例18: AddToToolbox

	def AddToToolbox (self, tool):
		if len(self._toolbox) < 4:
			if tool == 'mat' and 'mat' in self._toolbox:
				self._feedback = 'oneOnly'
				return False
			obj = viz.addTexQuad(parent=viz.ORTHO, scene=self._window, size=75)
			obj.setParent(self._hud)
			obj.setPosition(-60+len(self._toolbox)*45, 60, 0)
			obj.setScale(1,.4,1)
			tool = self._factory.FilterAddedTool(tool)	# adds 'ful' for 'can' if full
			textur = viz.addTexture('textures/tool_'+tool+'.png', useCache=True)
			textur_sel = viz.addTexture('textures/tool_'+tool+'_sel.png', useCache=True)
			obj.texture(textur)
			self._toolbox[tool] = {'obj': obj, 'tex': textur, 'sel': textur_sel}
			return True
		else:
			self._feedback = 'inventory'
			self.DisplayLocalMessage('inventory')
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:18,代码来源:Window.py


示例19: __init__

    def __init__(self,physEnv,dimensions,axisAngle,position,texPath,texScale,planeABCD):
        
        # A wall object invludes a specialized visNode
        # This visNode is actually a texQuad

        ################################################################################################
        ################################################################################################
        ## Set variables
        
        self.dimensions = dimensions;
        self.axisAngle = axisAngle;
        self.position = position;
        self.texPath = texPath;
        self.texScale = texScale;
        
        ################################################################################################
        ################################################################################################
        ##  Create visNode: a texture quad
        
        self.visNode = viz.addTexQuad()
        self.visNode.setScale(dimensions[0],dimensions[1])
        self.visNode.setPosition(position)
        self.visNode.setAxisAngle(axisAngle)
        self.visNode.disable(viz.DYNAMICS)
        self.visNode.enable([viz.LIGHTING,viz.CULL_FACE])

        # Put texture on the quad  
        matrix = vizmat.Transform()
        matrix.setScale([dimensions[0]/texScale,dimensions[1]/texScale,texScale])
        
        self.visNode.texmat(matrix)
        
        self.texObj = viz.addTexture(texPath)
        self.texObj.wrap(viz.WRAP_T, viz.REPEAT)
        self.texObj.wrap(viz.WRAP_S, viz.REPEAT)
        self.visNode.texture(self.texObj)
        
        ################################################################################################
        ################################################################################################
        ##  Create physNode plane
        
        self.physNode = physEnv.makePhysNode('plane',planeABCD)
开发者ID:YanjieGao,项目名称:ExperimentBase,代码行数:42,代码来源:visEnv.py


示例20: __init__

	def __init__ (self, view, color, eyeH):
		self._view = view
#		self._player_matrix = viz.Matrix() #self.view.getMatrix()
		self._avatar = Robot.Steve()
		self._avatar.disable([viz.INTERSECTION, viz.PICKING], op=viz.OP_ROOT)
		self._avatar.head.setScale([1.5,1.5,1.5])
		self._avatar.body_root.setScale([1.5,1.5,1.5])
		#self._avatar.disable(viz.PHYSICS)
		bodyColor = [float(c)/255 for c in color[0]]
		shadeColor= [float(c)/255 for c in color[1]]
		self._avatar.setBodyColor(bodyColor)
		self._avatar.setShadeColor(shadeColor)
#		self._avatar.setTracker(self._player_matrix)
		self._avatar.setTracker(viz.link(self._view, viz.NullLinkable,offset=[0,-0.25,0]))
		self._view.collision(viz.ON)
		self._view.eyeheight(eyeH)
		# add the representation on the map
		self._mapAva = viz.addTexQuad(size=.75)
		#self._mapAva = vizshape.addSphere(.5,10,10)
		self._mapAva.texture(viz.addTexture('textures/mapAva_icon.png'),'',0)
		self._mapAva.color(bodyColor)
		self._updateFunc = vizact.onupdate(0, self.UpdatePlayer)
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:22,代码来源:Avatar.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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