WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #32  
Old 03-21-2006, 10:47 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
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
Now, when I shoot the avatars, they fall and disappear, as planned. The problem I'm having is that the face still stays on the screen.

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
Is there a reason why the face stays floating in the air. I'm assuming it should disappear with the body. Please help.

Thanks
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:47 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC