Main Content

play

Play recorded animation data

Since R2025a

    Description

    play(world) plays the recorded 3D animation data from a MAT (MAT file from MATLAB®) file. To load the MAT file, use the load function.

    The play function opens the Simulation 3D Viewer window with buttons to view the recorded animation. To view details in a tooltip, point to each button. You can also use the keyboard shortcuts and mouse controls to navigate in the recorded environment. For more information on the keyboard shortcuts, see Navigate in 3D Environment.

    Simulation 3D viewer window with buttons

    You can interact with the animation using these buttons in the Simulation 3D Viewer window.

    • Reset time to zero button — Reset time to zero

    • Repeat animation is off button — Repeat animation is off

    • Repeat animation is on button — Repeat animation is on

    • Stop button — Stop

    • Step backward button — Step backward

    • Play button — Play

    • Pause button — Pause

    • Step forward button — Step forward

    You can only record the actor transformation data during the simulation. You can also set the scene using the Scene argument of the sim3d.World object to play back the recorded animation. For more information about the limitations in recording 3D animation data, see Limitations.

    example

    Examples

    collapse all

    Load the data file and play the animation using play function.

    Create a world object.

    world = sim3d.World();

    Load the MAT file with animation data.

    load(world,"World2_anim.mat");

    Play the animation.

    play(world);

    Simulation 3D viewer window with buttons

    Input Arguments

    collapse all

    World object that defines the 3D environment, specified as a sim3d.World object.

    Example: world = sim3d.World()

    Version History

    Introduced in R2025a