主要内容

follow

R2026b

Move camera to follow actor

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    follow(actr) moves the camera for the current viewer to focus on the specified actor and follow the actor during simulation.

    When you follow an actor, the interactive controls for the viewer change:

    • Pan interactions rotate around the target instead of panning the map.

    • Zoom interactions zoom toward and away from the target.

    follow(v,actr) moves the camera for viewer v to focus on the specified actor and follow the actor during simulation.

    follow(___,Offset=offset) additionally specifies a camera offset from the target.

    Input Arguments

    collapse all

    Target actor, specified as an Actor object or "none". When you specify "none", the camera stops following a target and the interactive controls for the viewer restore to their defaults.

    Viewer, specified as a GlobeViewer object. When you do not specify a viewer, the function uses the current viewer.

    Camera offset from the target actor, in meters, specified as a 1-by-3 numeric vector of the form [xEast yNorth zUp]. Specify this argument using east-north-up (ENU) coordinates with respect to the origin of the target actor. For example, a value of [30 0 0] positions the camera 30 meters east of the target actor.

    When you do not specify offset, the function positions the camera 100 meters away from the target actor at a 45 degree angle.

    Data Types: double

    Version History

    Introduced in R2026b

    See Also

    Objects

    Functions