|
#1
|
|||
|
|||
Faces
I'm a bit new to Vizard and Python in general. I'm trying to make a program that would allow the user to select between different faces. Here is part of the code:
import viz viz.go(viz.HMD) #Add a male avatar, idling and facing the viewer. male = viz.add('Male.cfg') #define position of avatar, x is horizontal, y is vertical, z is depth male.translate(0,0,1) male.rotate(0,1,0,180) male.face('stan.jpg') #define a choice variable choice = viz.input('Prompt for action') if choice > 12 print 'bad choice' #1 = neutral 2 = walk 3 = walk180 #4 = jog 5 = wave 6 = shout #7 = shot 8 = laying still 9 = sit throw #10 = sit down 11 = stand up 12 = loiter male.state(choice) I get errors on the if statement and on the male.state(choice) Also, i am not able to access stan.jpg. The error is fail to load file. Please help |
#2
|
|||
|
|||
For you first question, you need a ":" at the end off all "if" statements. If that's news to you then you should definitely read the Programming 101 tutorial included at the end of the tutorials chapter.
Regarding your file not found error, the error there is that you can't use the avatar face() command to apply jpegs. You can only apply Vizard PeopleMaker files. Please ask for assitance by someone at your faciltiy regarding PeopleMaker or feel free to post here again if no one in your group is already familiar with that. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|