Appearance
KBE3D / KBCore / Cesium / GlobeTranslucency
类: GlobeTranslucency
Properties for controlling globe translucency.
属性
enabled
enabled:
boolean
When true, the globe is rendered as a translucent surface. <br /><br /> The alpha is computed by blending Globe#material, Globe#imageryLayers, and Globe#baseColor, all of which may contain translucency, and then multiplying by GlobeTranslucency#frontFaceAlpha and GlobeTranslucency#frontFaceAlphaByDistance for front faces and GlobeTranslucency#backFaceAlpha and GlobeTranslucency#backFaceAlphaByDistance for back faces. When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry is considered front facing. <br /><br /> Translucency is disabled by default.
frontFaceAlpha
frontFaceAlpha:
number
A constant translucency to apply to front faces of the globe. <br /><br /> GlobeTranslucency#enabled must be set to true for this option to take effect.
示例
ts
// Set front face translucency to 0.5.
globe.translucency.frontFaceAlpha = 0.5;
globe.translucency.enabled = true;frontFaceAlphaByDistance
frontFaceAlphaByDistance:
NearFarScalar
Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera. The translucency will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, frontFaceAlphaByDistance will be disabled. <br /><br /> GlobeTranslucency#enabled must be set to true for this option to take effect.
Examples
ts
// Example 1.
// Set front face translucency to 0.5 when the
// camera is 1500 meters from the surface and 1.0
// as the camera distance approaches 8.0e6 meters.
globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
globe.translucency.enabled = true;ts
// Example 2.
// Disable front face translucency by distance
globe.translucency.frontFaceAlphaByDistance = undefined;backFaceAlpha
backFaceAlpha:
number
A constant translucency to apply to back faces of the globe. <br /><br /> GlobeTranslucency#enabled must be set to true for this option to take effect.
示例
ts
// Set back face translucency to 0.5.
globe.translucency.backFaceAlpha = 0.5;
globe.translucency.enabled = true;backFaceAlphaByDistance
backFaceAlphaByDistance:
NearFarScalar
Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera. The translucency will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, backFaceAlphaByDistance will be disabled. <br /><br /> GlobeTranslucency#enabled must be set to true for this option to take effect.
Examples
ts
// Example 1.
// Set back face translucency to 0.5 when the
// camera is 1500 meters from the surface and 1.0
// as the camera distance approaches 8.0e6 meters.
globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
globe.translucency.enabled = true;ts
// Example 2.
// Disable back face translucency by distance
globe.translucency.backFaceAlphaByDistance = undefined;rectangle
rectangle:
Rectangle
A property specifying a Rectangle used to limit translucency to a cartographic area. Defaults to the maximum extent of cartographic coordinates.
构造函数
构造函数
new GlobeTranslucency():
GlobeTranslucency
返回
GlobeTranslucency
