WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-19-2006, 11:43 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Exclamation 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
Reply With Quote
  #2  
Old 01-23-2006, 09:16 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
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.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 09:25 AM.


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