![]() |
|
#1
|
|||
|
|||
Try using the director function for just reading in the network data. To update the avatar register a callback function with vizact.ontimer or vizact.onupdate.
|
#2
|
|||
|
|||
Hi. i did modify my code, but i don't work correctly.
please modify my code Code:
import viz import vizmat import vizinfo import socket import struct viz.go() #Add an avatar to the scene female = viz.add('vcc_female.cfg') viz.clearcolor(0.5,0.5,1) female.setPosition([-0.08,0,0.8]) female.setEuler([0,0,0]) female.scale(1.4,1,1) #Get a handle to the Arm bone Forearm = female.getBone('Bip01 R Forearm') Forearm.lock() Forearm.setEuler(0, -5, 0) UpperArm = female.getBone('Bip01 R UpperArm') UpperArm.lock() UpperArm.setEuler(0, -30, -80) Hand = female.getBone('Bip01 R Hand') Hand.lock() Head = female.getBone('Bip01 Head') Head.lock() Head.setPosition(-100,0,0) Neck = female.getBone('Bip01 Neck') Neck.lock() Neck.setEuler(0,0,-15) UDP_IP="localhost" UDP_PORT=8000 sock = socket.socket( socket.AF_INET, # Internet socket.SOCK_DGRAM ) # UDP sock.bind( (UDP_IP,UDP_PORT) ) udp = 0 def example1(): global udp while True: data, addr = sock.recvfrom( 1024 ) # buffer size is 1024 bytes udp = struct.unpack(">d", data)[0] True.close() viz.director(example1) def update(): print udp right = open('c:\\ownership\\test4.txt', 'a+') right.write(str(udp)+'\n') if 0 < udp: a = Forearm.getEuler() A = a[2] n = max(A -0.5,-90) N = A + 90 Forearm.setEuler(0,0,n) if n == -90: Forearm.setEuler([0,0,N]) else : b = Forearm.getEuler() B = b[2] n2 = min(B +0.2,0) Forearm.setEuler(0,0,n2) vizact.ontimer(0,update) |
#3
|
|||
|
|||
Hi. worldviz.
is this not solved my problem?? i want to your help. i don't solved my problem |
#4
|
|||
|
|||
What's not working?
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Loading OSG models and orientation | Joran | Vizard | 4 | 06-18-2009 05:43 AM |
intersense with 5DT glove | sjp | Vizard | 2 | 04-06-2009 07:22 AM |
Problems loading WRL file | DrunkenBrit | Vizard | 2 | 01-29-2009 12:58 AM |
Loading .3ds-Files without interrupting Program flow | Stefan | Vizard | 10 | 06-08-2005 04:44 PM |
Script loading problem | JRichizzle | Vizard | 1 | 03-12-2004 10:03 AM |