Home > Designing > Panda3D video cube example

Panda3D video cube example

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: , ,
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.