主要内容

removeMeshNode

R2026b

Remove 3D mesh node and child nodes from RoadRunner Viewer scene graph

Since R2026b

    Description

    removeMeshNode(rrViewer,Node=node) removes the 3D mesh node Node and all of its child nodes from the scene graph of the specified RoadRunner Viewer object rrViewer.

    example

    Examples

    collapse all

    Use the addMeshNode function to add a 3D mesh to the RoadRunner Viewer scene graph. Then, use removeMeshNode to remove it.

    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 and specify the RoadRunner Viewer object rrViewer and the path to the 3D mesh file. The path you specify must be relative to the Assets folder in your project.

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

    To remove the 3D mesh from the RoadRunner Viewer scene graph, use removeMeshNode and specify the RoadRunner Viewer object rrViewer and the Node object to remove.

    removeMeshNode(rrViewer,Node=sedan)

    Input Arguments

    collapse all

    RoadRunner Viewer object from which to remove a 3D mesh node, specified as a roadrunnerViewer object.

    3D mesh node to remove, specified as a Node object. This function also removes all child nodes of node.

    Limitations

    • The removeMeshNode function does not support specifying more than one Node object to remove at a time.

    Version History

    Introduced in R2026b