Main Content

sim3d.sensors.MainCamera

Create main camera actor to define perspective in Simulation 3D Viewer window

Since R2022b

    Description

    Use the sim3d.sensors.MainCamera object to create a virtual main camera object in the 3D environment. You can use the main camera actor to define a perspective of the 3D environment in the Simulation 3D Viewer window.

    Creation

    The sim3d.sensors.MainCamera class is created by the createViewport function of the sim3d.World class and stored in the Viewports property.

    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.sensors.MainCamera 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.sensors.MainCamera object.

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

    Unique ID of the sensor, specified as a real positive scalar.

    Data Types: uint32

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real 1-by-3 vector, in m. Use Translation to change the position of the sim3d.sensors.MainCamera object in the 3D environment along the X, Y, and Z axes of the coordinate system. When you add an actor to the 3D environment, the default parent actor is the Scene Origin at (0,0,0).

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

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real 1-by-3 vector, in rad. Use Rotation to rotate the sim3d.sensors.MainCamera object in the 3D environment.

    Example: camera.Rotation = [pi/4,pi/8,pi/2]

    Version History

    Introduced in R2022b