Tranimate

RTSX Help: Frame animation in 3D

tranimate

Animate a 3D motion from a start frame to end frame.

Syntax

  • tranimate(T1, T2, options)
  • tranimate(T,options)
  • tranimate(Tseq,options)

Input Arguments

  • T, T1, T2  — a   4 x 4 homogeneous transformation matrix , or 3 x 3 rotation matrix, or quaternion data structure
  • Tseq — a   4 x 4 x nq homogeneous transformation matrix sequence, or 3 x 3 x nq rotation matrix sequence

Output Arguments

  • none.

Options

Note : options in [ ] must be passed to the function in pairs.

  • ‘world’ — plot world coordinate for comparison
  • ‘grid’ — show grid
  • ‘hold’ — hold frames from previous plots. Must use with ‘figure’ option to plot on the same figure
  • ‘holdstart’ — hold start frame
  • ‘noreplay’ — bypass the replay loop at end of function
  • [ ‘figure’, fnum] — command the plot to a particular window indicated by fnum
  • [ ‘speed’, s] — animation speed 1 = slowest, 10 = fastest
  • [ ‘nsteps’, n] — number of steps along the path (default 50)
  • [ ‘color’, ‘(your choice)’] — plot in a particular color. Choices are ‘black’, ‘blue’, ‘green’, ‘cyan’, ‘red’, ‘purple’, ‘yellow’, ‘white’
  • [ ‘linestyle’,'(your choice)’] — plot in a particular line style. Choices are ‘solid’ (‘-‘), ‘dash’ (‘–‘), ‘dash dot’ (‘-.’), ‘longdash dot’ (‘–.’), ‘bigdash dot’ (‘=.’), ‘bigdash longdash’ (‘=–‘), ‘dot’ (‘.’), ‘double dot’ (‘..’)

Description

tranimate(T1, T2, options) animates a 3D coordinate frame moving from T1 to T2, where T1 and T2 can be represented by homogeneous transformation matrices (4 x 4), rotation matrices (3 x 3), or quaternions

tranimate(T, options) animates a coordinate frame moving from world frame to T

tranimate(Tseq, options) animates a trajectory Tseq

Examples

Try the following commands to see the response.

R = rotx(pi/2);
tranimate(R);
tranimate(R,'world');
R0 = rotz(-1)*roty(-1);
R1 = rotz(1)*roty(1);
q0 = Quaternion(R0);
q1 = Quaternion(R1);
q = qinterp(q0, q1, [0:49]'/49);
tranimate(q);

See Also

  • trplot — plot a transformed frame in 3-dimension