WorldViz User Forum coalesceing euler angles
 Register FAQ Search Today's Posts Mark Forums Read

#1
05-27-2004, 02:35 PM
 epl Member Join Date: Feb 2004 Posts: 7
coalesceing euler angles

Hi to everyone on the board. I have a quick question that I hope someone can answer. Currently I am in the process of developing some vizard code that will simulate inconsistent eye contact between an avatar and the user equipped with a head mounted display. The HMD outputs the euler angles of the users head movements. The euler angles are then fed into the avatar.avstu.command() function after some additional processing to achieve an appropriate level of eye contact. At a certain point I am have the avatar completely break away from being dependent on the euler angles generated from the HMD. From here I have two sets of euler angles, one being generated by the computer and one generated by the HMD. I was wondering if anyone has a good idea on how I can smoothly synchronize these euler angles, so that the avatar is once again dependent on the HMD values. Thanks.

----
Eric Laschinger
epl@umail.ucsb.xxx
Research Assistant
RECVEB UCSB
#2
05-27-2004, 02:56 PM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
Hi,

From my understanding you want a way to smoothly interpolate between two sets of euler angles? If this is the case then I would suggest to convert the euler angles to quaternions and use the slerp function to linearly interpolate between them. Example:
Code:
```import vizmat
euler1 = [60,45,67]
euler2 = [-5,0,54]

quat1 = vizmat.EulerToQuat(euler1)
quat2 = vizmat.EulerToQuat(euler2)

#Interpolate 75% between quat1 and quat2
quat = vizmat.slerp(quat1,quat2,0.75).get()```
To smoothly interpolate all you need to do is setup a timer that will increment the interpolation percentage from 0 to 1. However, you will need to find a way to convert the quaternion back to an euler angle since the old avatars don't accept quaternions. The newer avatars accept quaternions, but if you have already put a lot of development into your project then I would suggest to convert the quaternions to eulers.
#3
05-28-2004, 05:07 PM
 epl Member Join Date: Feb 2004 Posts: 7
bug in vizmat.slerp()

When running vizmat.slerp() i recieve the error depicted in the attached screen shot. It seems that you are performing an unsupported operation on two lists on line 130 of vizmat.py.

a snippit of my offending code is as follows:

euler1 = [unsynchyaw, unsynchpitch, unsynchroll]
euler2 = [realyaw, realpitch, realroll]
quat1 = vizmat.EulerToQuat(euler1)
quat2 = vizmat.EulerToQuat(euler2)
#Interpolate sucsessive iterations from 0/100 to 100/100 between quat1 and quat2
quat = vizmat.slerp(quat1, quat2, (resynchcntr/100)).get()
#quat = [0,1,2,3]

let me know if you can find any kind of work around for this.

thx eric.
Attached Images
 slerpbug.jpg (499.6 KB, 712 views)
#4
05-28-2004, 05:10 PM
 epl Member Join Date: Feb 2004 Posts: 7
no cut and paste in output window?

also... just a thought in a future build of vizard could you enable cut, copy of text sent to the output tab of the interactive window (thats why i attached the jpg)? That might be something that would really improve usability of the program.
#5
05-28-2004, 05:15 PM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
Hi Eric,

Sorry about that, the slerp function expects quaternion objects as input, not lists. The example code should look like the following:
Code:
```import vizmat
euler1 = [60,45,67]
euler2 = [-5,0,54]

quat1 = vizmat.EulerToQuat(euler1)
quat2 = vizmat.EulerToQuat(euler2)

#Interpolate 75% between quat1 and quat2
quat = vizmat.slerp(viz.Quat(quat1),viz.Quat(quat2),0.75).get()```
#6
05-28-2004, 05:18 PM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
Hi Eric,

Regarding the output window, you should be able to highlight some text then right-click on it and select Copy
#7
05-28-2004, 05:25 PM
 epl Member Join Date: Feb 2004 Posts: 7
thanks

yeah i always use cntrl-c, cntrl-x.. thanks tho

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

All times are GMT -7. The time now is 03:02 AM.