View Single Post
  #2  
Old 07-09-2009, 12:52 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the undocumented vizshape module to create a box with each face split into a separate sub-node, allowing you to apply a different texture. Here is some sample code:
Code:
import viz
import vizshape
viz.go()

#Create box with each face split into separate sub-node
box = vizshape.addBox([1,1,1],splitFaces=True,pos=(0,1.8,4))
box.addAction(vizact.spin(0,1,0,45))

#Create textures
t1 = viz.add('image1.jpg')
t2 = viz.add('image2.jpg')

#Apply first texture to front/back face
box.texture(t1,node='front')
box.texture(t1,node='back')

#Apply second texture to left/right face
box.texture(t2,node='left')
box.texture(t2,node='right')
Reply With Quote