Thread: Video Texturing
View Single Post
  #2  
Old 04-08-2008, 05:18 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Does the video show up fine when you apply it to a texture quad, like in the following example?
Code:
import viz
viz.go()

video = viz.add('Trailer1.mpg')
video.play()

viz.addTexQuad(texture=video,pos=(0,1.8,2))
If so, then your Thing.ive model might now have correct texture coordinates. You will need to add the texture coordinates in your modeling software and re-export it.

Also, here is an example that shows how to perform functions while a button is pressed:
Code:
import viz
viz.go()

viz.add('gallery.ive')

#Add buttons for turning viewpoint left/right
lbutton = viz.addButtonLabel('Turn Left',pos=(0.4,0.1,0))
rbutton = viz.addButtonLabel('Turn Right',pos=(0.6,0.1,0))

#Setup timers for turning viewpoint
TURN_SPEED = 90.0
def TurnView(speed):
	viz.MainView.setEuler(speed*viz.elapsed(),0,0,viz.HEAD_ORI,viz.REL_LOCAL)
turnLeftTimer = vizact.ontimer(0,TurnView,-TURN_SPEED)
turnRightTimer = vizact.ontimer(0,TurnView,TURN_SPEED)

#Disable timers initially
turnLeftTimer.setEnabled(False)
turnRightTimer.setEnabled(False)

#Enable turn left timer while turn left button is down
vizact.onbuttondown(lbutton,turnLeftTimer.setEnabled,True)
vizact.onbuttonup(lbutton,turnLeftTimer.setEnabled,False)

#Enable turn right timer while turn right button is down
vizact.onbuttondown(rbutton,turnRightTimer.setEnabled,True)
vizact.onbuttonup(rbutton,turnRightTimer.setEnabled,False)
Reply With Quote