WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Rotation and Euler (https://forum.worldviz.com/showthread.php?t=1002)

Jerry 02-15-2007 10:16 AM

Rotation and Euler
 
When I rotate and object with obj.rotate(0,90,30) and then get the
Euler angles with obj.get(viz.EULER), in Viz 2.5 I get
[-21.9, 90, 8.06], but in Viz 3 I get [75, 90, 105].
Why the difference. Which is correct? Why aren't the Euler angles
the same as the angles in the rotate command?

farshizzo 02-15-2007 10:26 AM

The algorithm to extract the euler angles from a rotation matrix was slightly modified in Vizard 3.0. However, all the values are correct. This is simply the nature of euler angles. There are multiple ways to represent one orientation using euler angles. If you converted each of those euler angles into a quaternion, you would get roughly the same value:
Code:

>>>vizmat.EulerToQuat(0,90,30)
  [0.68301272392272949, -0.1830126941204071, 0.1830127090215683, 0.68301272392272949]
>>>vizmat.EulerToQuat(-21.9,90,8.06)
  [0.68307656049728394, -0.18277427554130554, 0.18277427554130554, 0.68307656049728394]
>>>vizmat.EulerToQuat(75,90,105)
  [0.68301272392272949, -0.18301267921924591, 0.18301267921924591, 0.68301272392272949]



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

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