yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #02133
Re: How se3 and ori is stored
Thanks, Vaclav. So, orientation is stored as [q0,q1,q2,q3] but printed for the user as [ [axisX,axisY,axisZ],angle]. Now I understand.
There is one more confusion. The following was from the archive. The one in bold confuses me. Is se3 stored as [[X,Y,Z],[q0,q1,q2,q3]]?
> from euclid import *
> O.load('scene.xml')
>
> q1 = Quaternion.new_rotate_axis(pi/6, Vector3(0,1,0)) # rotate about Y
> on pi/6 angles
> q2 = Quaternion.new_rotate_axis(pi/2, Vector3(0,0,1)) # rotate about Z
> on pi/2 angles
>
> # now, YADE's se3 is [X,Y,Z, Ax,Ay,Az, a]
> # where X,Y,Z is the body's position;
> # Ax,Ay,Az is the rotation axis,
> # a is the rotation angle.
> # So, we...
> o1 = q1.get_angle_axis() # get angle and axis for the first blue box
> (rotation about Y)
> o2 = (q2*q1).get_angle_axis() # get angle and axis for the second blue
> box (first rotation about Y, after this rotation aboud Z)
> # Then, we set the parameters,
> O.bodies[1].phys['se3'] = [0,0,0, o1[1][0], o1[1][1], o1[1][2], o1[0]]
> O.bodies[3].phys['se3'] = [0,0,0, o2[1][0], o2[1][1], o2[1][2], o2[0]]
Yours,
CWBoon
_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop
Follow ups
References