Main Content

sim3d.environment.WeatherConfiguration

Control scene weather and sun position

Since R2024b

    Description

    Use the sim3d.environment.WeatherConfiguration object to create a weather configuration object to control the weather and the position of the sun in the 3D environment. After you create a sim3d.environment.WeatherConfiguration object, you can modify aspects of the environment by setting property values.

    Creation

    Description

    weather = sim3d.environment.WeatherConfiguration() creates a default weather configuration object in the 3D environment.

    weather = sim3d.environment.WeatherConfiguration(Name=Value) sets properties using one or more name-value arguments. For example, to control the position of the sun, set EnableGeospatialSun to true.

    Properties

    expand all

    Sun Attributes

    Altitude angle in a vertical plane between the rays of the sun and the horizontal projection of the rays, specified as any value between -90 and 90, in deg.

    Diagram of sun altitude angle (vertical arrow) and sun azimuth angle (horizontal arrow)

    Use the SunAltitude and SunAzimuth properties to control the time of day in the scene. For example, to specify sunrise in the north, set SunAltitude to 0 deg and SunAzimuth to 180 deg.

    Example: weather.SunAltitude = 60

    Data Types: double

    Azimuth angle in the horizontal plane measured from the south to the horizontal projection of the sun rays, specified as any value between 0 and 360, in deg.

    Diagram of sun altitude angle (vertical arrow) and sun azimuth angle (horizontal arrow)

    Use the SunAltitude and SunAzimuth properties to control the time of day in the scene. For example, to specify sunrise in the north, set SunAltitude to 0 deg and SunAzimuth to 180 deg.

    Example: weather.SunAzimuth = 50

    Data Types: double

    Option to enable geospatial sun, specified as 0 (false) to not enable the geospatial sun or 1 (true) to enable it. Enabling geospatial sun is useful to simulate conditions near the poles or at locations with disproportionate lengths of day versus night.

    Example: EnableGeospatialSun = 1

    Data Types: logical

    Latitude of geolocation on earth, specified as a scalar, in deg.

    Example: weather.Latitude = 4

    Dependencies

    To set Latitude, set EnableGeospatialSun to 1.

    Data Types: double

    Longitude of geolocation on earth, specified as a scalar, in deg.

    Example: weather.Longitude = 5

    Dependencies

    To set Longitude, set EnableGeospatialSun to 1.

    Data Types: double

    Time zone that specifies the number of hours offset from the Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT), specified as any value between -12 and 12.

    Example: weather.Longitude = 5

    Dependencies

    To set TimeZone, set EnableGeospatialSun to 1.

    Data Types: double

    Option to enable daylight saving time, specified as 0 (false) if daylight saving time is not enabled or 1 (true) if it is enabled.

    Example: weather.IsDaylightSavingTime = 1

    Dependencies

    To set IsDaylightSavingTime, set EnableGeospatialSun to 1.

    Data Types: logical

    Date, specified as an integer in the format YYYY-MM-DD.

    Example: weather.Date = 2024-07-01

    Dependencies

    To set Date, set EnableGeospatialSun to 1.

    Data Types: string

    Time, specified as an integer in the format HH:MM:SS.

    Example: weather.Time = 1:30:00

    Dependencies

    To set Time, set EnableGeospatialSun to 1.

    Data Types: string

    Weather Attributes

    Density of clouds, specified as any value between 0 and 100, in percent. This property controls the amount of light that can pass through the clouds, making them appear transparent or dense.

    Example: weather.CloudDensity = 40

    Data Types: double

    Speed of clouds, specified as any value between -100 and 100. The clouds move from west to east for positive values and east to west for negative values.

    Example: weather.CloudSpeed = 50

    Data Types: double

    Option to enable volumetric clouds, specified as 0 (false) if volumetric clouds are not enabled or 1 (true) if they are enabled.

    Example: weather.EnableVolumetricClouds = 1

    Data Types: logical

    Amount of clouds, specified as any value between 0 and 100, in percent.

    Example: weather.CloudCoverage = 50

    Dependencies

    To set CloudCoverage, set EnableVolumetricClouds to 1.

    Data Types: double

    Height of clouds at which they appear, specified as any value between 5 and 20, in km.

    Example: weather.CloudAltitude = 10

    Dependencies

    To set CloudAltitude, set EnableVolumetricClouds to 1.

    Data Types: double

    Amount of rain particles, specified as any value between 0 and 100, in percent. This property controls how heavy or light the rain appears in the scene as well as wetness, rain puddles, and ripples. Use CloudDensity and RainDensity properties to control rain in the environment.

    Example: weather.RainDensity = 50

    Data Types: double

    Option to enable raindrops on camera lens, specified as 0 (false) if raindrops on the camera lens are not enabled or 1 (true) if they are enabled.

    Example: weather.EnableRaindropsOnLens = 1

    Data Types: double

    Thickness of fog, specified as any value between 0 and 100, in percent. This property controls how opaque or transparent the fog appears in the scene.

    Example: weather.FogDensity = 50

    Data Types: double

    Amount of snowfall, specified as any value between 0 and 100, in percent. This property controls the intensity of snowfall.

    Example: weather.RainDensity = 50

    Data Types: double

    More About

    expand all

    Version History

    Introduced in R2024b