Scene & Globe¶
Scene and globe configuration options.
Scene¶
scene
¶
Scene and post-processing configuration for CesiumJS viewers.
Classes:
| Name | Description |
|---|---|
ClippingPlane |
A clipping plane in Hessian normal form. |
ClippingPlaneCollection |
A set of planes used to clip tilesets, models, or the globe. |
ClassificationPrimitive |
A filled polygon drawn by classifying terrain or 3D Tiles. |
BloomConfig |
Bloom glow configuration. |
FXAAConfig |
Fast approximate anti-aliasing configuration. |
AmbientOcclusionConfig |
Screen-space ambient occlusion configuration. |
PostProcessConfig |
Built-in post-processing effects for a CesiumJS scene. |
SceneConfig |
Configuration applied to a CesiumJS scene after viewer creation. |
ClippingPlane
¶
Bases: CesiumBase
A clipping plane in Hessian normal form.
normal must be a normalized Cartesian vector. distance is the
signed shortest distance from the coordinate-system origin to the plane.
The coordinate system is determined by the object that owns the clipping
plane collection.
Methods:
| Name | Description |
|---|---|
from_point_normal |
Create a plane through an ECEF or local Cartesian point. |
from_point_normal
classmethod
¶
from_point_normal(point: Cartesian3, normal: Cartesian3) -> ClippingPlane
Create a plane through an ECEF or local Cartesian point.
ClippingPlaneCollection
¶
Bases: CesiumBase
A set of planes used to clip tilesets, models, or the globe.
With union_clipping_regions=False (the default), a region is clipped
only when it is outside every plane. With it enabled, a region is clipped
when it is outside any plane.
ClassificationPrimitive
¶
Bases: CesiumBase
A filled polygon drawn by classifying terrain or 3D Tiles.
Classification reuses the depth of the surface it sits on instead of
rendering its own geometry, so the polygon drapes perfectly over
hills and buildings. The polygon ring is positions (ECEF
:class:Cartesian3 values, usually from :class:Cartesian3FromDegrees)
between height and extruded_height above the ellipsoid. Cesium
requires surface-following classification geometry to be a closed volume.
BloomConfig
¶
Bases: CesiumBase
Bloom glow configuration.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate statements for Cesium's built-in bloom stage. |
to_js_statements
¶
Generate statements for Cesium's built-in bloom stage.
FXAAConfig
¶
Bases: CesiumBase
Fast approximate anti-aliasing configuration.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate the FXAA enablement statement. |
to_js_statements
¶
Generate the FXAA enablement statement.
AmbientOcclusionConfig
¶
Bases: CesiumBase
Screen-space ambient occlusion configuration.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate statements for Cesium's ambient-occlusion stage. |
to_js_statements
¶
Generate statements for Cesium's ambient-occlusion stage.
PostProcessConfig
¶
Bases: CesiumBase
Built-in post-processing effects for a CesiumJS scene.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate statements for every explicitly configured effect. |
to_js_statements
¶
Generate statements for every explicitly configured effect.
SceneConfig
¶
Bases: CesiumBase
Configuration applied to a CesiumJS scene after viewer creation.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate JavaScript statements for the configured scene values. |
to_js_statements
¶
Generate JavaScript statements for the configured scene values.
Globe¶
globe
¶
Globe configuration for CesiumJS viewer.
Classes:
| Name | Description |
|---|---|
GlobeConfig |
Configuration for the CesiumJS globe. |
GlobeConfig
¶
Bases: CesiumBase
Configuration for the CesiumJS globe.
Generates JS statements to configure globe properties after viewer creation.
Methods:
| Name | Description |
|---|---|
to_js_statements |
Generate JS statements to configure the globe after viewer creation. |
to_js_statements
¶
Generate JS statements to configure the globe after viewer creation.
Terrain can be vertically exaggerated relative to a reference height:
globe = cesiumkit.GlobeConfig(
terrain_exaggeration=3.0,
terrain_exaggeration_relative_height=100.0,
)
viewer = cesiumkit.Viewer(globe=globe)
CesiumJS 1.144 applies these settings through the scene's vertical
exaggeration properties; GlobeConfig provides the Python-facing grouping.
Clipping planes¶
Tilesets, models, and the globe can be clipped by a set of planes. Each plane is expressed in Hessian normal form using a normalized Cartesian normal and a signed distance from the owning object's coordinate-system origin. See How to clip and classify 3D Tiles.
planes = cesiumkit.ClippingPlaneCollection(
planes=[
cesiumkit.ClippingPlane(
normal=cesiumkit.Cartesian3(x=0, y=1, z=0),
distance=5.0,
)
]
)
tileset = cesiumkit.Cesium3DTileset(url="https://example.com/tileset.json", clipping_planes=planes)
union_clipping_regions=True clips a region when it is outside any plane;
the default requires it to be outside every plane. enabled=False keeps
the planes but turns clipping off.
Classification¶
ClassificationPrimitive (or the viewer.add_classification() helper)
draws a filled polygon that drapes over terrain or 3D Tiles by reusing
their depth:
viewer.add_classification(
[
cesiumkit.Cartesian3FromDegrees(longitude=-74.02, latitude=40.70),
cesiumkit.Cartesian3FromDegrees(longitude=-73.98, latitude=40.70),
cesiumkit.Cartesian3FromDegrees(longitude=-74.00, latitude=40.74),
],
color=cesiumkit.Color(red=0.0, green=0.6, blue=0.9, alpha=0.6),
)
Cesium renders surface-following classification geometry only when it is an
extruded volume. The default spans 0 to 100,000 meters above the ellipsoid;
set height and extruded_height to bounds that enclose the terrain or 3D
Tiles you need to classify.
Fog, atmosphere, and antialiasing¶
SceneConfig exposes the stable scene-quality knobs that don't change the
viewer's construction:
scene = cesiumkit.SceneConfig(
fog_density=0.0002,
fog_minimum_brightness=0.5,
atmosphere_hue_shift=0.1,
atmosphere_saturation_shift=-0.05,
msaa_samples=4,
)
viewer = cesiumkit.Viewer(scene=scene)
fog_*maps toscene.fog(density, minimum brightness, screen-space error factor).atmosphere_*maps toscene.skyAtmosphere(brightness/hue/saturation shifts, each in[-1, 1]).msaa_samplessetsscene.msaaSamples(1-16).
Rendering performance¶
Viewer constructor controls expose explicit rendering, resolution scaling, frame-rate limits, and render-loop error reporting:
viewer = cesiumkit.Viewer(
request_render_mode=True,
maximum_render_time_change=0.0,
resolution_scale=0.75,
target_frame_rate=30,
show_renderer_errors=True,
)
SceneConfig also exposes request_render_mode and
maximum_render_time_change for post-construction scene configuration.
Post-processing¶
Bloom, FXAA, and ambient occlusion are independently configurable. No stages are changed unless a config is explicitly supplied:
scene = cesiumkit.SceneConfig(
post_process=cesiumkit.PostProcessConfig(
bloom=cesiumkit.BloomConfig(enabled=True, contrast=128, brightness=-0.3),
fxaa=cesiumkit.FXAAConfig(enabled=True),
ambient_occlusion=cesiumkit.AmbientOcclusionConfig(enabled=True, intensity=1),
)
)
viewer = cesiumkit.Viewer(scene=scene)