View Single Post
  #3  
Old 11-21-2011, 01:05 AM
4711 4711 is offline
Member
 
Join Date: Jan 2010
Posts: 15
Using the "splitFaces" parameter from <vizshape>.addBox allows you to create a box with six subnodes, one for each side of the box, each of which can be handled independently. That way you can easily apply a different texture to each side of the box.

See the example code for <vizshape>.addBox from the Vizard 3.0 documentation:
Code:
import viz
import vizshape
viz.go()

#Create box with each face split into separate sub-node
box = vizshape.addBox(splitFaces=True)
box.setPosition(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