from direct.showbase.ShowBase import ShowBase
class Game(ShowBase):
def __init__(self):
ShowBase.__init__(self)
count = 8 #change this
angle = 360/count
dummy=render.attachNewNode("dummyNode")
# I always asume that Y is forward/backward axis
# Next line move node 60 units forward relative to self (because dummy is first argument)
dummy.setY(dummy,60)
# Rotate dummy so models will be visible once in array around dummy
dummy.setP(dummy,60) # we set Pitch (rotate around its X axis)
for i in range(count):
dummy.setH(dummy,angle)
# rotate dummy node around its vertical (Z) axis, relative to self
x = loader.loadModel("smiley")
# Smiley model is bad, its face is pointing to its negative Y
# parent our model/node under dummy, thus using its position and rotation (coordinate space is correct term)
x.reparentTo(dummy)
# move model 10 meters/units forward, relative to self
# note that face should look outward, but because model is not correct, it is pointing inwards
x.setY(x,10)
# we copy model to other place in tree (render root in this case)
# and we respect its transform, so it remains at same global coordinates
x.wrtReparentTo(render)
x = Game()
x.run()