Hello,
I had a question on how Vizard handles alpha maps when imported
from files.
I've got a scene with lava spewing forth and in order to make it look like
it is moving I used the tutorial for transforming a texture across an object:
Code:
import viz
viz.go()
#Load the Skull graphics
skull = viz.add('SkullGraphics/Skull.IVE')
leftEyeLava = viz.add('SkullGraphics/LeftEyeLave.IVE')
rightEyeLava = viz.add('SkullGraphics/RightEyeLave.IVE')
mouthLava = viz.add('SkullGraphics/MouthLava.IVE')
leftEyeLava_Tex = viz.addTexture('images/LavaFlow_01.tga')
leftEyeLava_Tex.wrap(viz.WRAP_S,viz.REPEAT)
leftEyeLava_Tex.wrap(viz.WRAP_T,viz.REPEAT)
rightEyeLava_Tex = viz.addTexture('images/LavaFlow_01.tga')
rightEyeLava_Tex.wrap(viz.WRAP_S,viz.REPEAT)
rightEyeLava_Tex.wrap(viz.WRAP_T,viz.REPEAT)
mouthLava_Tex = viz.addTexture('images/LavaFlow_01.tga')
mouthLava_Tex.wrap(viz.WRAP_S,viz.REPEAT)
mouthLava_Tex.wrap(viz.WRAP_T,viz.REPEAT)
lLavaIter = 0.0
rLaveIter = 0.0
mLaveIter = 0.0
def onTimer(num):
global lLavaIter
global rLaveIter
global mLaveIter
#Get the textures matrix
leftEyeLava_Tex_Matrix = vizmat.Transform()
#Move the matrix forward
leftEyeLava_Tex_Matrix.setTrans([0,lLavaIter,1])
#Set the textures matrix
leftEyeLava.texmat(leftEyeLava_Tex_Matrix,'',0,False,viz.OP_OVERRIDE)
lLavaIter += 0.1
viz.callback(viz.TIMER_EVENT,onTimer)
viz.starttimer(0,0.11,viz.FOREVER)
My problem is that the texture moves just fine, however the alpha does
not move with the texture as well.
I am using a TGA file that I made in photoshop with an alpha imbeded
which has a bunch of 'holes'. My hope was that these holes
would move with the texture to give the appearance of hot lava
pouring forth.
Right now I've only got the lava moving but the alpha stays static.
Is there a simple fix to this, or do I need to apply my own custom alpha
channel and move that as well as the texture?
Thanks,
George