Main Content

sim3d.graphics.Arrow

Create arrow actor

Since R2024a

    Description

    Use the sim3d.graphics.Arrow object to create an arrow object in the 3D environment to visualize relevant vector data during simulation. After you create a sim3d.graphics.Arrow object, you can modify the aspects of the arrow actor by setting property values. You can create N number of arrow actors in the 3D environment using sim3d.graphics.Arrow object.

    Creation

    Description

    actor = sim3d.graphics.Arrow() creates a default arrow actor object in the 3D environment.

    actor = sim3d.graphics.Arrow(Name=Value) specifies options using one or more optional name-value arguments. For example, to create an arrow actor at the position [0,1,0], set Translation to [0,1,0].

    Input Arguments

    expand all

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: arrow = sim3d.graphics.Arrow(ActorName='Arrow',Translation=[3,4,3],Color=[1,1,0]) creates an arrow actor with the specified actor name, position and color.

    Example: arrows = sim3d.graphics.Arrow(ActorName='Arrows',Translation=[3,2,3; 3,5,3; 3,3,3],Color=[1,1,0; 1,0,0; 0,1,0]) creates three arrow actors with the specified actor name, positions and colors.

    Name of actor, specified as a character array or string. If you do not specify an actor name, then the software assigns the actor an autogenerated name. Use this argument to set the name of the sim3d.graphics.Arrow object.

    Note

    If you specify the same name as an actor that already exists, then the software appends actor name you specify with a unique identifier.

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real N-by-3 array, in m. N specifies the number of actors. When you add an actor to the 3D environment, the default parent actor is the Scene Origin at (0,0,0).

    Example: Translation=[3,4,3]

    Example: Translation=[3,2,3; 3,5,3; 3,3,3]

    Data Types: double

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real N-by-3 array, in rad.

    Example: Rotation=[0,pi/2,-pi/4]

    Example: Rotation=[0,pi/2,-pi/4; 0,pi/2,-pi/4; 0,pi/2,-pi/4]

    Data Types: double

    Relative scaling in x, y, and z coordinates of the actor object to its parent actor, specified as a real N-by-3 array.

    Example: Scale=[1,2,1]

    Example: Scale=[2,2,2; 2,2,2; 2,2,2]

    Data Types: double

    Base color of actor, specified as real N-by-3 array of RGB triplet values. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green and blue components of the color. The intensities must be in the range [0, 1].

    Example: Color=[0,1,0]

    Example: Color=[1,0,0; 0,0,1; 1,1,0]

    Data Types: double

    Total length of arrow including the arrow head, specified as real positive N-by-1 vector, in m.

    Example: Length=2

    Example: Length=[0.5; 0.5; 0.5]

    Data Types: double

    Option to hide the actor from the 3D environment scene, specified as 0 (false) if the actor is visible in the scene or 1 (true) if the actor is hidden in the scene. For N number of actors, specify as a logical N-by-1 vector.

    Example: Hidden=1

    Example: Hidden=[1; 0; 1]

    Properties

    expand all

    Parent of actor, specified as a handle to the parent actor object. After you add an actor to the sim3d.World object, the default parent actor is the Scene Origin at [0,0,0]. Use this property to set any actor in the 3D environment as the parent actor of a sim3d.graphics.Arrow object.

    This property is read-only.

    Children of actor, specified as a structure. Each field of the structure contains a handle to the child of a sim3d.graphics.Arrow object.

    Parent world, specified as a handle to the parent sim3d.World object. You can use this property only if the sim3d.graphics.Arrow object is added to the parent sim3d.World object.

    Actor orientation representation in the 3D environment, specified as 'Default', 'MATLAB', 'ISO8855', 'AERO', 'VRML', or 'SAE'. The values are not case-sensitive. To display the actor transformation in the specified coordinate system, set this property first, and then set the transform properties Translation, Rotation, and Scale.

    Coordinate System Description
    'Default'

    The default coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Counterclockwise rotation about Z-axis

    Three dimensional default coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'MATLAB'

    The MATLAB® coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward left.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional MATLAB coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'ISO8855'

    The ISO 8855 standard coordinate system, in m and deg. For more information, see ISO Standards.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward left.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional ISO8855 coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'AERO'

    The coordinate system for aerospace applications, in m and rad. For more information, see Body Coordinates (Aerospace Blockset).

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points downward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional aero coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'VRML'

    The X3D ISO standard coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points upward.

    • Z-axis points toward right.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Counterclockwise rotation about Y-axis

    • Yaw — Counterclockwise rotation about Z-axis

    Three dimensional VRML coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'SAE'

    The SAE J670 standard coordinate system, in m and rad. For more information, see SAE International Standards.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points downward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional SAE coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    Data Types: string

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real N-by-3 array, in m. N specifies the number of actors. When you add an actor to the 3D environment, the default parent actor is the Scene Origin at (0,0,0).

    Example: arrow.Translation = [1,2,1]

    Example: arrows.Translation = [1,4,2; 1,3,2; 1,2,2]

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real N-by-3 array, in rad.

    Example: arrow.Rotation = [0,pi/2,pi/8]

    Example: arrows.Rotation = [pi/2,pi/4,pi/2; 0,pi/4,pi/2; pi,pi/2,0]

    Relative scaling in x, y, and z coordinates of the actor object to its parent actor, specified as a real N-by-3 array.

    Example: arrow.Rotation = [0,pi/2,pi/8]

    Example: arrows.Rotation = [pi/2,pi/4,pi/2; 0,pi/4,pi/2; pi,pi/2,0]

    Base color of actor, specified as real N-by-3 array of RGB triplet values. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green and blue components of the color. The intensities must be in the range [0, 1].

    Example: arrow.Color = [0,1,0]

    Example: arrows.Color = [1,0,0; 0,0,1; 1,1,0]

    Data Types: double

    Total length of arrow including the arrow head, specified as real positive N-by-1 vector, in m.

    Example: arrow.Length = 2

    Example: arrows.Length = [0.5; 0.5; 0.5]

    Data Types: double

    Option to hide the actor from the 3D environment scene, specified as 0 (false) if the actor is visible in the scene or 1 (true) if the actor is hidden in the scene. For N number of actors, specify as a logical N-by-1 vector.

    Example: arrow.Hidden = 1

    Example: arrows.Hidden = [1; 0; 1]

    Version History

    Introduced in R2024a