WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-25-2017, 01:13 PM
tianmoran tianmoran is offline
Member
 
Join Date: Nov 2016
Posts: 16
vizconnect and track the position of real human movement

Dear all,

I recently need to use Polhemus to track the head and shoulder movement of the real human. But actually, I don't know how to do it with Polhemus.

I checked the vizconnect tutorial and tried to first do this with my keyboard and mouse (as Polhemus is currently unavailable), but couldn't find a way to record the position of my keyboard or mouse or the avatar I added.

Then a friend sent me the codes:
Code:
import viz
import vizinput
import time

global mark1, mark2, mark3, mark4
polhemus = viz.add('polhemus.dle')		
mark1 = polhemus.addLiberty() 			
mark2 = polhemus.addLiberty() 			
mark3 = polhemus.addLiberty() 			
mark4 = polhemus.addLiberty() 			

def WriteResults_Time(mark1,mark3,mark4,fileName):
	now = viz.tick()						
	HeadPos = mark1.getPosition()
	HeadRot = mark1.getEuler()
	LeftHandPos = mark3.getPosition()
	LeftHandRot = mark3.getEuler()
	RightHandPos = mark4.getPosition()
	RightRot = mark4.getEuler()
		
	Save_results = open(fileName,'Avatar')
			
	vars = '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' %(
	numTrial, now, 
	HeadPos[0], HeadPos[1], HeadPos[2], 
	HeadRot[0], HeadRot[1], HeadRot[2], 
	LeftHandPos[0], LeftHandPos[1], LeftHandPos[2], 
	LeftHandRot[0], LeftHandRot[1], LeftHandRot[2],
	RightHandPos[0], RightHandPos[1], RightHandPos[2],  
	RightHandRot[0], RightHandRot[1], RightHandRot[2])
	Save_results.write(vars)

vizact.ontimer(0,Polhemus_Record)
Because I couldn't try those codes with my keyboard or mouse, so just want to ask is there anything I need to change? Or are there any solution for me to track the movement of real person and apply it onto an avatar?

Many thanks!
Reply With Quote
Reply

Tags
apply, track motions, vizconnect

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 01:24 PM.


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