WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Faces (https://forum.worldviz.com/showthread.php?t=482)

betancourtb82 01-19-2006 11:43 AM

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

tobin 01-23-2006 09:16 PM

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.


All times are GMT -7. The time now is 08:00 AM.

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