sim3d.environment.WeatherConfiguration
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
Syntax
Description
creates a default weather configuration object in the 3D environment.weather
= sim3d.environment.WeatherConfiguration()
sets properties using one or more name-value arguments. For example, to control the
position of the sun, set weather
= sim3d.environment.WeatherConfiguration(Name=Value
)EnableGeospatialSun
to
true
.
Properties
Sun Attributes
SunAltitude
— Altitude angle
40
(default) | any value between -90
and 90
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.
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
SunAzimuth
— Azimuth angle
90
(default) | any value between 0
and 360
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.
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
EnableGeospatialSun
— Option to enable geospatial sun
0
or false
(default) | 1
or true
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
— Latitude of geolocation on earth
0
(default) | scalar
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
— Longitude of geolocation on earth
0
(default) | scalar
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
TimeZone
— Time zone
-5.0
(default) | any value between -12.0
and 12.0
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
IsDaylightSavingTime
— Option to enable daylight saving time
0
or false
(default) | 1
or true
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
— Date
2023-01-01
(default) | integer
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
— Time
10:30:00
(default) | integer
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
CloudDensity
— Density of clouds
10
(default) | any value between 0
and 100
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
CloudSpeed
— Speed of clouds
10
(default) | any value between -100
and 100
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
EnableVolumetricClouds
— Option to enable volumetric clouds
0
or false
(default) | 1
or true
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
CloudCoverage
— Amount of clouds
0
(default) | any value between 0
and 100
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
CloudAltitude
— Height of clouds
6
(default) | any value between 5
and 20
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
RainDensity
— Amount of rain particles
0
(default) | any value between 0
and 100
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
EnableRaindropsOnLens
— Option to enable raindrops on camera lens
0
or false
(default) | 1
or true
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
FogDensity
— Thickness of fog
0
(default) | any value between 0
and 100
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
SnowDensity
— Amount of snowfall
0
(default) | any value between 0
and 100
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
Sun Position
Use SunAltitude
and SunAzimuth
to control the
sun position.
SunAltitude
— Altitude angle in a vertical plane between the sun rays and the horizontal projection of the rays.SunAzimuth
— Azimuth angle in the horizontal plane measured from the south to the horizontal projection of the sun rays.
Alternatively, enable EnableGeospatialSun
to use
Latitude
, Longitude
, Date
,
Time
, and TimeZone
to control sun position.
Enabling geospatial sun allows you to simulate conditions near the poles or at locations
with disproportionate lengths of day versus night.
This table summarizes sun position settings for specific times of day.
Time of Day | Property Settings | 3D Environment |
---|---|---|
Midnight |
|
|
Sunrise in the north |
|
|
Noon |
|
|
Clouds
Use CloudDensity
and CloudSpeed
to control
clouds in the scene. Set EnableVolumetricClouds
to use
CloudCoverage
and CloudAltitude
to control
volumetric clouds in the scene.
This table summarizes settings for specific cloud conditions.
Cloud Condition | Property Settings | 3D Environment |
---|---|---|
Clear |
|
|
Heavy |
|
|
Heavy |
|
|
Fog
Use FogDensity
to control fog in the scene.
This table summarizes settings for specific fog conditions.
Fog Condition | Property Settings | 3D Environment |
---|---|---|
None |
|
|
Heavy |
|
|
Rain
Use CloudDensity
and RainDensity
to control
rain in the scene.
This table summarizes settings for specific rain conditions.
Rain Condition | Property Settings | 3D Environment |
---|---|---|
Light |
|
|
Heavy |
|
|
Snow
Use SnowDensity
to control snow in the scene.
This table summarizes settings for specific snow conditions.
Snow Condition | Property Settings | 3D Environment |
---|---|---|
Heavy | SnowDensity : 50 |
|
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)