WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1  
Old 05-27-2004, 02:35 PM
epl epl is offline
Member
 
Join Date: Feb 2004
Posts: 7
Send a message via AIM to epl
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
Reply With Quote
  #2  
Old 05-27-2004, 02:56 PM
farshizzo farshizzo is offline
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.
Reply With Quote
  #3  
Old 05-28-2004, 05:07 PM
epl epl is offline
Member
 
Join Date: Feb 2004
Posts: 7
Send a message via AIM to epl
Question 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
File Type: jpg slerpbug.jpg (499.6 KB, 1491 views)
Reply With Quote
  #4  
Old 05-28-2004, 05:10 PM
epl epl is offline
Member
 
Join Date: Feb 2004
Posts: 7
Send a message via AIM to epl
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.
Reply With Quote
  #5  
Old 05-28-2004, 05:15 PM
farshizzo farshizzo is offline
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()
Reply With Quote
  #6  
Old 05-28-2004, 05:18 PM
farshizzo farshizzo is offline
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
Reply With Quote
  #7  
Old 05-28-2004, 05:25 PM
epl epl is offline
Member
 
Join Date: Feb 2004
Posts: 7
Send a message via AIM to epl
thanks

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

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


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