Vizard 8 » Command Index » Vizard modules » vizshape » <vizshape>.addBox
8.1

<vizshape>.addBox

Adds a box

<vizshape>.addBox(  
size = [1,1,1]  
right = True  
left = True  
top = True  
bottom = True  
front = True  
back = True  
splitFaces = False  
)  
size = [1,1,1]
Box dimensions
right = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
left = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
top = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
bottom = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
front = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
back = True
If splitFaces = True and this argument is set to True a sub-node will be created for this face of the box.
splitFaces = False
When this argument is set to True sub-nodes will be created for each face of the box set to True.

Remarks

This command will return a box that can be split into sub-nodes for the individual faces.

Return Value

<node3D> object

Example

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')