Hi folks,
I have been trying to spawn an avatar model a few feet in front of the main view. I can get it to spawn at the location of the main view but not in front. I can offset the spawn location but not in relation to the viewpoint. Any help would be much appreciated.
Code:
def AddBot():
x,y,z,d = viz.MainView.getAxisAngle()
a,b,c = viz.MainView.getPosition()
modelfile = randint(1,3)
dudestate = randint(1, 14)
if modelfile == 1:
dude = viz.add('vcc_male.cfg')
elif modelfile == 2:
dude = viz.add('vcc_male2.cfg')
elif modelfile == 3:
dude = viz.add('vcc_female.cfg')
dude.state(dudestate)
dude.setPosition(a + 5,b,c, viz.REL_LOCAL)
dude.setAxisAngle(0,y,0,d)
ColShape = Cloud.collideMesh()
dude.collideCapsule()
vizact.onbuttondown(button_addbot, AddBot)