View Single Post
  #1  
Old 07-03-2008, 07:38 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Help with avatar.lookAt

Hi. I am trying to make an avatar enter a room, walk to a certain location, pause and look at two empty chairs (first at one and then the other) and then proceed to walk to one of the empty chairs. Here is my script:

Code:
partner.addAction(vizact.walkto(-2.15, 0, -0.1, WALK_SPEED, 90, viz.AVATAR_WALKSTEP))
partner.state(1)
###Here I need to look at each chair
partner.addAction(vizact.walkto(-1.1, 0, 1.4, WALK_SPEED, 90, viz.AVATAR_WALKSTEP))#walk to chair far
partner.state(1)
partner.addAction(vizact.spinto(0, 1, 0, 140, 200))
partner.state(1)
I tried using partner.addAction(vizact.lookat(-1.1, 0, 1.4,90)) to look at the chair (it is at (-1,1,0,1.4)). But this made the whole avatar turn, not the head. I looked in the manual and they said something about using the neck, but I have no neck bone in my resources.

I thought of using partner_head.setEuler(pitch,yaw,roll) However, when I do this it is not synchronized with the actions....it just tilts the head before he even starts walking! I thought perhaps I could just use a vizact.waitTime??

Also, if using head.setEuler is there any way to control the speed of the movement?

And if I can use head.setEuler, if I have two points (say I know the avatar is at point (x,y,z) and the chair I want to look at is at (a,b,c), how can I calculate what euler to set? Would I use viz.ABSOLUTE_GLOBAL or some relative scheme?



Finally, is there a way to make the avatar sit down slowly? Right now we just set their position and so they move down to the chair very quickly..

Any help would be appreciated!
Reply With Quote