![]() |
#2
|
|||
|
|||
Here's an example, navigate around and you'll see a pigeon appear in front of the view every two seconds:
Code:
import viz import vizact viz.go() viz.addChild('piazza.osgb') avatar = viz.addAvatar('pigeon.cfg',pos=[0,0,6],euler=[180,0,0],scale=[4,4,4]) avatar.state(1) def spawnAvatar(): pos = viz.MainView.getPosition() yaw = viz.MainView.getEuler()[0] vector = viz.MainView.getMatrix().getForward() amount = 5 x,y,z = vizmat.MoveAlongVector(pos,vector,amount) a = avatar.clone(pos=[x,0,z],euler=[yaw-180,0,0],scale=[4,4,4]) vizact.ontimer(2,spawnAvatar) Last edited by Jeff; 02-25-2016 at 05:18 AM. |
Tags |
avatar, position, relative, viewpoint |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unexpected Avatar lookAt() behavior when using yield statements | chris2307 | Vizard | 2 | 12-17-2013 02:58 AM |
Avatar eye contact with user as it moves | Ducky | Vizard | 1 | 03-01-2013 12:23 PM |
How to make avatar always in front of youself (e.g. 20cm) when direction changes | Xianshi Xie | Vizard | 2 | 06-30-2009 11:13 AM |
Has user perception of avatar expressions been tested? | Karla | Vizard | 3 | 10-28-2008 10:32 AM |