本文整理汇总了Python中viz.addTexQuad函数的典型用法代码示例。如果您正苦于以下问题:Python addTexQuad函数的具体用法?Python addTexQuad怎么用?Python addTexQuad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addTexQuad函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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
示例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)
示例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()
示例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'])
示例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()
示例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
示例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)
示例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()
示例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)
示例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)
示例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()
示例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))
示例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])
示例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()