| Aerospace Toolbox | ![]() |
moveBody(h,idx,translation,rotation)
h.moveBody(idx,translation,rotation)
moveBody(h,idx,translation,rotation) and h.moveBody(idx,translation,rotation) set a new position and attitude for the body specified with the index idx in the animation object h. translation is a 1-by-3 matrix in the aerospace body coordinate system. rotation is a 1-by-3 matrix, in radians, that specifies the rotations about the right-hand x-y-z sequence of coordinate axes. The order of application of the rotation is z-y-x (R-Q-P).
Move the body with the index 1 to position offset from the original by + [0 0 -3] and rotation, rot1.
h = Aero.Animation;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
pos1 = h.Bodies{1}.Position;
rot1 = h.Bodies{1}.Rotation;
h.moveBody(1,pos1 + [0 0 -3],rot1);
addBody, createBody, removeBody, updateBodies
![]() | move (Aero.Node) | Node (Aero.Node) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |