Main Content

move (Aero.Node)

Change node translation and 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. The defined aerospace body coordinate system is defined relative to the screen as x-left, y-in, z-down.

rotation is a 1-by-3 matrix specified as an Euler angle, in radians, that specifies the rotations about the right-hand x-y-z coordinate axes. The order of application of the rotation is z-y-x (yaw, pitch, and roll (Y-P-R)). 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. The defined VRML coordinate system is defined relative to the screen as x-right, y-up, z-out.


collapse all

Use the Simulink® 3D Animation™ vrnode/getfield function to retrieve the translation and rotation. These coordinates are those used in the animation software.

h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = 'asttkoff.wrl';

Figure VR Plane Take-Off contains objects of type hgjavacomponent, uimenu, uipanel, uitoolbar.

newtrans = getfield(h.Nodes{2}.VRNode,'translation') - [0 40 6];
newrot = [0.4 0.3 0.1];


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).

Version History

Introduced in R2007b

See Also