Thread: Video Texturing
View Single Post
  #1  
Old 04-08-2008, 11:13 AM
cheezus69 cheezus69 is offline
Member
 
Join Date: Jan 2008
Posts: 2
Video Texturing

Hi, I'm new to the forums, I've been guided here by my lecturer at Uni. I'm trying to texture a box, but it doesn't seem to want to work properly. Here's the bit of my code that does the video...

Code:
import viz

viz.go()
viz.clearcolor(0.5,0.5,1)

cinemas = viz.add('Thing.ive')

Screen01 = cinemas.getchild('Screen01')
Screen01Trailer = viz.addVideo('Trailer1.mpg')
Screen01Trailer.rate(1)
Screen01.texture(Screen01Trailer)

global Trailer01Play
Trailer01Play = 'FALSE'

def mouseclick(button):
	global Trailer01Play

	print 'mouse clicked'

	if button == viz.MOUSEBUTTON_LEFT:
		pickObject = viz.pick()

	if pickObject.valid() and pickObject == Screen01 and Trailer01Play == 'FALSE':
		Screen01Trailer.play()
		Trailer01Play = 'TRUE'
		print 'Trailer 1 Playing'
		return()
	elif pickObject.valid() and pickObject == Screen01 and Trailer01Play == 'TRUE':
		Screen01Trailer.stop()
		Trailer01Play = 'FALSE'
		print 'Trailer 1 Stopped'
		return()
		
viz.callback(viz.MOUSEDOWN_EVENT,mouseclick)
...it plays the sound ok, but the video is weird, it kind of seems to show random single colours from the video file. Any chance you know what I'm doing wrong here??

Thanks in advance for any help you can give!...

P.S. While I'm here too, another problem I'm having is, is it possible to have a GUI that has buttons (in this case arrows) that can be held down and have a constant action. Basically, I'm making this thing as if it can go on a touch screen, and I want to be able to hold down on the up arrow on the GUI and it will move forward for as long as you hold it down, as opposed to how it's doing it now, with it having to be pressed lots of times to move forward.
Reply With Quote