WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Regarding getting yaw, pitch, roll separately frm 'vizconnect.getEuler('trac') functn (https://forum.worldviz.com/showthread.php?t=5792)

rajnishv 07-16-2016 03:47 AM

Regarding getting yaw, pitch, roll separately frm 'vizconnect.getEuler('trac') functn
 
Hi Jeff,
I need each of the euler values separately from
vizconnect.getTracker('HeadTracker').getEuler():
I have managed to get the euler values of the head tracker by the code thrugh vizconnect.
Code:
#------------------------------Vizrad Code Start---------------------------------#

def restrictRollFromHeadTracker():
headTracker=vizconnect.getTracker('dtrackheadtrack er')
eulrHeadTracker=headTracker.getEuler()
print 'the position and euler are',eulrHeadTracker
vizact.ontimer(0,restrictRollFromHeadTracker)

#------------------------------Vizrad Code End---------------------------------#

But i need each of the values 'separately' such as..yaw,pitch and roll and want to store into 3 separate variables and then want to apply on the tracker node with some different values.

I am not able to found the code or command to deal with it.

Waiting for ur reply.
Thanx & Regards!!!

Mr.Rajnish Vishwakarma
Software Developer
at
Xenium Digital Pvt. Ltd,Mumbai
(Customer of world viz)

Jeff 07-16-2016 03:58 AM

The getEuler() command return a list with yaw, pitch, and roll. You can get the individual values directly:

Code:

yaw,pitch,roll = vizconnect.getTracker('HeadTracker').getEuler()
Or first save the list and then get the individual values:

Code:

ori = vizconnect.getTracker('HeadTracker').getEuler()
yaw = ori[0]
pitch = ori[1]
roll = ori[2]


rajnishv 07-16-2016 04:00 AM

Sorry Jeff,
To disturb you.
Thanx for the reply.
I got it when i got an error that getEuler returs a list and i managed it to store it.
Thank you for ur reply

rajnishv 07-16-2016 04:19 AM

Jeff,
One more query ,i want to re-apply the same yaw ,pitch to the head tracker but i have to restrict the roll value of the head tracker so that roll doesn't work using the code,but i m not able to get it:

#----------Start----------------
def restrictRollFromTracker():
headTracker=vizconnect.getTracker('headtracker')
eulrHeadTracker=headTracker.getEuler()
yaww=eulrHeadTracker[0]
pitchh=eulrHeadTracker[1]
headTracker.getNode3d().setEuler([yaww,pitchh,0],viz.ABS_PARENT )

vizact.ontimer(0,restrictRollFromTracker)


But i m not able to retrict the roll value of the tracker again.Pls help.
#-----End---------------



Waiting for ur reply.
Thanx & Regards!!!

Mr.Rajnish Vishwakarma
Software Developer
at
Xenium Digital Pvt. Ltd,Mumbai
(Customer of world viz)

Jeff 07-16-2016 04:49 AM

In this case you don't need to get the yaw, pitch, and roll values. Just get a handle to the tracker link and use the link.setEuler operator:

Code:

trackerLink = vizconnect.getTracker('headtracker').getLink()
#Keep the incoming yaw and pitch, but zero the roll
trackerLink.setEuler([None,None,0])



All times are GMT -7. The time now is 06:05 AM.

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