PDA

View Full Version : TexQuad Visibility


miss
02-20-2018, 05:56 PM
I have set up a screen with multiple textures in a single quad using a for loop. I have used the viz.addTexture command to add textures from a list I have specified before.

However, I want to remove the visibility of these textures on viztask.waitKeyDown. I am unable to do so. Can anyone please help me out with that?

Jeff
02-21-2018, 09:18 PM
Here's an example that removes a texture from a texture quad:

import viz
import viztask
viz.go()

piazza = viz.addChild('piazza.osgb')
texture = viz.addTexture('lake3.jpg')
quad = viz.addTexQuad(pos=[0,1.8,3])
quad.texture(texture)

def textureTask():
yield viztask.waitKeyDown(' ')
quad.texture(None)
yield viztask.waitKeyDown(' ')
quad.texture(texture)
yield viztask.waitKeyDown(' ')
quad.remove()

viztask.schedule( textureTask() )