Contenu principal

reset

R2026b

Clear RoadRunner Viewer scene graph

Since R2026b

    Description

    reset(rrViewer) removes all 3D mesh nodes, primitive collections, and overlays from the scene graph of the specified RoadRunner Viewer object.

    example

    Examples

    collapse all

    Add a 3D model, such as a Sedan.fbx file, from your project folder to the RoadRunner Viewer scene graph. Then use reset to clear the scene graph. This example assumes you have already added the folder containing the RoadRunner API to your MATLAB® path and created a project folder. For information on getting started with RoadRunner Viewer, see Get Started with RoadRunner Viewer (RoadRunner Scenario).

    Specify the path to a project folder. RoadRunner Viewer uses the 3D mesh, material, and image files in the Assets folder of the specified project.

    If you do not have a project folder and want to create one that already contains an Assets folder with sample files, create a RoadRunner project. By default, RoadRunner projects contain an Assets folder prepopulated with sample assets, such as a Sedan.fbx file, that you can use in RoadRunner Viewer. For information on creating a RoadRunner project, see RoadRunner Project and Scene System (RoadRunner).

    myProject="C:\users\MyProject"

    Open RoadRunner Viewer and specify your project folder.

    rrViewer = roadrunnerViewer(ProjectFolder=myProject);
    

    To add a 3D mesh, Sedan.fbx, from your project to the RoadRunner Viewer scene graph, use addMeshNode. The path you specify must be relative to the Assets folder in your project.

    sedan = addMeshNode(rrViewer,Filepath="Vehicles/Sedan.fbx");

    Clear the scene graph of the specified RoadRunner Viewer object rrViewer.

    reset(rrViewer)

    Input Arguments

    collapse all

    RoadRunner Viewer object from which to clear all objects, specified as a roadrunnerViewer object.

    Limitations

    • The reset function clears everything from the RoadRunner Viewer scene graph. You cannot specify individual objects to clear.

    Version History

    Introduced in R2026b