![]() |
|
#1
|
|||
|
|||
|
Guys I have a small problem. Basically I would like to calculate the distance between the avatar and the main camera (player) in the scene. Do anyone have some kind of idea how to do that?
|
|
#2
|
|||
|
|||
|
You can use the vizmat.Distance command to calculate the distance between two points:
Code:
import viz
import vizmat
import vizact
viz.go()
avatar = viz.addAvatar('vcc_male2.cfg',pos=[0,0,5],euler=[180,0,0])
head = avatar.getBone('Bip01 Head')
def printDistance():
avatarPos = head.getPosition(viz.ABS_GLOBAL)
viewPos = viz.MainView.getPosition()
distance = vizmat.Distance(avatarPos,viewPos)
print distance
vizact.ontimer(1,printDistance)
|
|
#3
|
|||
|
|||
|
Thank you so so much !!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Avatar & Motion Capture Interface | Angie | Vizard | 1 | 08-05-2010 06:17 PM |
| avatar scale and link.setpos conflict? | sircedric4 | Vizard | 0 | 09-29-2009 07:48 AM |
| Collision of an avatar with a quad | Frank Verberne | Vizard | 8 | 06-04-2008 09:44 AM |
| Looking through the eyes of an avatar | Frank Verberne | Vizard | 2 | 04-01-2008 05:52 AM |
| How to make avatar's eyes to blink when speaking | michelcm3 | Vizard | 12 | 01-15-2008 08:48 AM |