yade-users team mailing list archive
Mailing list archive
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 *
> 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.phys['se3'] = [0,0,0, o1, o1, o1, o1]
> O.bodies.phys['se3'] = [0,0,0, o2, o2, o2, o2]
New Windows 7: Simplify what you do everyday. Find the right PC for you.