![]() |
#32
|
|||
|
|||
New question, similar problem. I have now been told that the avatars must appear with different faces, based on an input. Here is what I have done so far:
Code:
#define a choice variable choice = viz.input("Please input the condition:") global facepic if choice == 1: facepic = 'biohead_talk.vzf' else: facepic = 'morph_head.vzf' #Create six avatars for i in range(NUM_AVATARS): newX = -10 * math.sin(theta * i) newZ = 10 * math.tan(theta * i) if newZ <=10: newZ = -15 else: newZ = 10 * math.tan(theta * i) #print i,"\t\t\t\t\t",newX,"\t",newZ male = viz.add('male.cfg') male.face(facepic) male.scale(1.25,1.25,1.25) male.translate(newX,-10,newZ) avPos = male.get(viz.POSITION) print 'original avatar position', avPos male.rotate(180,0,0) avatars.append(male) #Save avatar in list Here is the code for removing the avatars once shot: Code:
#Check if bullet intersected with anything info = viz.intersect(pos,futurePos) if info.intersected: print 'intersect point is',info.intersectPoint if info.object in avatars: WaitThenFreeze = vizact.sequence( vizact.waittime(info.object.getduration(7)-0.005), vizact.speed_node(0) ) info.object.execute(7) info.object.clear(viz.ALL) info.object.clear(viz.CURRENT_ACTION) info.object.add(WaitThenFreeze) #Add the action to the avatar RemoveAvatarAction = vizact.call(RemoveAvatar,info.object) info.object.add(RemoveAvatarAction) #Add action to remove avatar Thanks |
|
|