| Aerospace Toolbox | ![]() |
move(h,translation,rotation)
h.move(translation,rotation)
move(h,translation,rotation) and h.move(translation,rotation) set a new position and orientation for the node object h. translation is a 1-by-3 matrix in the aerospace body x-y-z coordinate system or another coordinate system. In the latter case, you can use the CoordTransformFcn function to move it into an aerospace body. 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). This function uses the CoordTransformFcn to apply the translation and rotation from the input coordinate system to the aerospace body. The function then moves the translation and rotation from the aerospace body to the VRML x-y-z coordinates.
Move the Lynx body. This example uses the Virtual Reality Toolbox™ vrnode/getfield function to retrieve the translation and rotation. These coordinates are those used in the Virtual Reality Toolbox software.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/vrtkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'vrtkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'vrtkoff.wrl'];
h.initialize();
newtrans = getfield(h.Nodes{4}.VRNode,'translation') + 1.0;
newrot = getfield(h.Nodes{4}.VRNode,'rotation') + [.2 0.01 0.01 0.01];
h.Nodes{4}.move(newtrans,newrot);This function cannot get the node position in aerospace body coordinates; it needs to use the CoordTransformFcn to do so.
This function cannot set a viewpoint position or orientation (see addViewpoint).
![]() | move (Aero.Body) | moveBody (Aero.Animation) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |