View Single Post
  #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