Archive

Posts Tagged ‘viideo’

Panda3D video cube example

March 27th, 2009 No comments

One of the major drawbacks of the Blender game engine is that it doesn’t support video textures. There is something under development but it is still in its early stages.

Panda3D on the other hand has solid support for video textures. Getting it to work is really easy:

import direct.directbase.DirectStart

#load movie texture from disk
tex = loader.loadTexture("trailer.avi")
#load 3D cube model (.egg file) from disk
cube = loader.loadModel("videotexttest")
#put the cube in the scenegraph
cube.reparentTo(render)
#set the cube's position
cube.setPos(0,42,0)
#apply the texture
cube.setTexture(tex)
#rotate the cube
cube.setHpr(45,0,0)
#scale the cube
cube.setScale(2)

#run the program
run()

The cube was created with Blender and then exporter with Chicken, a blender to .egg exporter.

Categories: Designing Tags: , ,