This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

play (Aero.VirtualRealityAnimation)

Animate virtual reality world for given position and angle in time series data




play(h) and animate the virtual reality world in h for the current TimeseriesDataSource at the specified rate given by the 'TimeScaling' property (in seconds of animation data per second of wall-clock time) and animated at a certain number of frames per second using the 'FramesPerSecond' property.

The time series data is interpreted according to the 'TimeseriesSourceType' property, which can be one of:


MATLAB® time series data with six values per time:

x y z phi theta psi

The values are resampled.


Simulink.Timeseries (Simulink® signal logging):

  • First data item

    x y z

  • Second data item

    phi theta psi


Simulink struct with time (for example, Simulink root outport logging 'Structure with time'):

  • signals(1).values: x y z

  • signals(2).values: phi theta psi

Signals are linearly interpolated vs. time using interp1.

'Array6DoF'A double-precision array in n rows and 7 columns for 6-DoF data: time x y z phi theta psi. If a double-precision array of 8 or more columns is in 'TimeseriesSource', the first 7 columns are used as 6-DoF data.
'Array3DoF'A double-precision array in n rows and 4 columns for 3-DoF data: time x z theta. If a double-precision array of 5 or more columns is in 'TimeseriesSource', the first 4 columns are used as 3-DoF data.
'Custom'Position and angle data is retrieved from 'TimeseriesSource' by the currently registered 'TimeseriesReadFcn'.

The time advancement algorithm used by play is based on animation frames counted by ticks:

ticks = ticks + 1;
time  = tstart + ticks*FramesPerSecond*TimeScaling;


TimeScalingSpecify the seconds of animation data per second of wall-clock time.
FramesPerSecondSpecify the number of frames per second used to animate the 'TimeseriesSource'.

For default 'TimeseriesReadFcn' methods, the last frame played is the last time value.

Time is in seconds, position values are in the same units as the geometry data loaded into the animation object, and all angles are in radians.


Animate virtual reality world, asttkoff.

h = Aero.VirtualRealityAnimation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
load takeoffData
[~, idxPlane] = find(strcmp('Plane', h.nodeInfo));
h.Nodes{idxPlane}.TimeseriesSource = takeoffData;
h.Nodes{idxPlane}.TimeseriesSourceType = 'StructureWithTime';
h.Nodes{idxPlane}.CoordTransformFcn = @vranimCustomTransform;;

See Also

Introduced in R2007b

Was this topic helpful?