View Single Post
  #1  
Old 10-15-2013, 08:51 AM
sleiN13 sleiN13 is offline
Member
 
Join Date: Dec 2008
Posts: 83
Bug in setPosition

I found a bug in the setPosition of Node3D (VizNode)

Code:
import vizshape, viz

viz.go()

vizshape.addGrid()
group1 = viz.addGroup()
group1.setPosition(3.0, 0.0, 10.0)
cube1 = vizshape.addCube(3.0, parent=group1)
cube1.setPosition(0.0,0.0,10.0, mode=viz.ABS_GLOBAL)
cube1.alpha(0.5)

group2 = viz.addGroup()
group2.setPosition(3.0, 0.0, 10.0)
cube2 = vizshape.addCube(2.0, color = (1.0,0.0,0.0), parent=group2)
cube2.setPosition((0.0,0.0,10.0), mode = viz.ABS_GLOBAL)
The following simple example should place the two cubes on the same location. Both use the "mode=viz.ABS_GLOBAL" flag to set the cube on "0.0, 0.0, 10.0" position. The first white cube will be placed correctly the second red cube will be placed relative to the parent.
Reply With Quote