#1
|
|||
|
|||
Texturing a quad from within a class
So I'm trying to texture a quad bound to the screen from within a class.
Can anyone explain why this sample code works : Code:
image = viz.add('Textures/VialLabels/Inventory Image - WHITE.png') quad = viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(0,0,0)) quad.texture(image) quad.setScale(6,3,1) Code:
import viz class inventory(object): global bulkInventoryBins,medicationVials def __init__(self,contentsImage=""): self.obj = viz.add('box.wrl') self.obj.infoImage = contentsImage def showInfoImage(self): self.infoQuad = viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(0,0,0)) self.infoQuad.texture(self.obj.infoImage) self.infoQuad.setScale(6,3,1) def removeInfoImage(self): self.infoQuad.remove() A = inventory("Textures/VialLabels/Inventory Image - WHITE.png") A.showInfoImage() viz.go() |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Jumping to a class object from one of it's components | EnvisMJ | Vizard | 0 | 04-25-2011 11:22 AM |
Collision of an avatar with a quad | Frank Verberne | Vizard | 8 | 06-04-2008 09:44 AM |
quad buffered stereo? | halley | Vizard | 2 | 10-19-2005 12:28 PM |
method of a class instance not accepted as Callback | Gilliard | Vizard | 1 | 08-10-2005 05:49 PM |
texturing on-the-fly objects | vr_boyko | Vizard | 1 | 05-11-2005 05:06 PM |