WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-29-2006, 07:27 PM
dellatails dellatails is offline
Member
 
Join Date: Jan 2006
Posts: 8
Smile animating people wandering in a room

Hi everyone,

I'm new here. I got a task of creating a virtual envirionment with avatars walking around in a room. Does anyone have any idea about how to do it efficiently? Should I first build the room model and avatars in Maya and load them into Vizard, or can I directly do it in Vizard. Also, a key problem is how to animate people walking around in the room? Any suggestion will be very much appreciated!

Della
Reply With Quote
  #2  
Old 01-31-2006, 12:01 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Vizard does not allow you to create content. You will have to first build the 3d files in a program such as 3DS Max or Maya. Once you have the content, animating the avatars shouldn't be too difficult. The avatars that come with Vizard already have walking animations. Vizard also comes with a module that allows you to specify locations for an avatar to walk to, and it will handle the animations for you. Search the documentation for the walkto command for more information. Let me know if you need anymore help.
Reply With Quote
  #3  
Old 02-04-2006, 12:44 PM
dellatails dellatails is offline
Member
 
Join Date: Jan 2006
Posts: 8
Hi farshizzo, thanks a lot for these helpful tips And it looks that Vizard provides some avatar models that I can use, so maybe I'll just build the room in Maya and load it. One more question, is there anyway that I can generate a set of walking paths (randomly would be more desirable) for each avatar instead of specifying the target locations using "walkto"? Thanks a lot!

Della
Reply With Quote
  #4  
Old 02-06-2006, 09:45 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

This is very easy to do with Vizard. I've attached some sample code that will have the avatar walk to a random location every time the spacebar is pressed. Let me know if something isn't clear.
Code:
import viz
viz.go()

#Initialize environment
viz.clearcolor(viz.GRAY)
viz.add('tut_ground.wrl')
viz.move(0,5,-20)
viz.lookat(0,0,0)

#Create an avatar
avatar = viz.add('female.cfg')

#Create a walk action that will randomly select a location between (-5,-5) and (5,5)
RandomWalkAction = vizact.walkto(vizact.randfloat(-5,5),0,vizact.randfloat(-5,5))

#Add walk action to avatar when spacebar is pressed
vizact.onkeydown(' ',avatar.add,RandomWalkAction)
Reply With Quote
  #5  
Old 02-13-2006, 12:44 PM
dellatails dellatails is offline
Member
 
Join Date: Jan 2006
Posts: 8
Hi farshizzo, thanks, the code looks very clear and helpful. Just one minor thing and it would be perfect.. how can I avoid keyboard input and just let the avatars working on their own randomly and endlessly?

I noted that in the gallery demo, they created an action using a bunch of actions.append(), and then called avatar.act(vizact.sequence(actions,viz.FOREVER)). Because I only have one random walk action, do I also need to create an action sequence first using actions.append? Many thanks!
Reply With Quote
  #6  
Old 02-13-2006, 01:02 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

That's correct. If you want the avatar to walk endlessly then you would place the walk action inside a sequence and have it repeat forever. Here is what the code would look like:
Code:
#Create a walk action that will randomly select a location between (-5,-5) and (5,5)
WalkForever = vizact.sequence(vizact.walkto(vizact.randfloat(-5,5),0,vizact.randfloat(-5,5)),viz.FOREVER)

#Add walk action to avatar
avatar.add(WalkForever)
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 05:35 PM.


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