WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-02-2008, 03:27 PM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Translating a texture and its Alpha

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
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:28 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC