一个点被创建,它的初始属性通过拨打
在3D 场景中定位的图形点, 即创建
and rendered using a PointPrimitiveCollection#add . 不要直接给建筑师打电话.
PointPrimitiveCollection.
Performance:
Reading a property, e.g., PointPrimitive#show, is constant time.
分配给财产是持续的时间,但会导致
CPU to GPU traffic when PointPrimitiveCollection#update is called. The per-pointPrimitive traffic is
同样的,无论更新了多少个属性。 如果收藏中的大多数要点需要
updated, it may be more efficient to clear the collection with PointPrimitiveCollection#removeAll
并添加新的点首键,而不是修改每个点.
Throws:
-
DeveloperError : scaleByDistance.far must be greater than scaleByDistance.near
-
DeveloperError : translucencyByDistance.far must be greater than translucencyByDistance.near
-
DeveloperError : distanceDisplayCondition.far must be greater than distanceDisplayCondition.near
Members
color : Color
获得或设置点的内色.
红色,绿色,蓝色,和α值由
值 的 红 , 绿色 表示,
如例1所示,NT+0 蓝色 NT+1 ,和 NT+2 alpha NT+3 属性. 这些组件范围从 NT 4 0.0 NT 5
(无强度)至 NT 0 1.0 NT 1 (全强度).
Examples:
// Example 1. Assign yellow.
p.color = Cesium.Color.YELLOW;
// Example 2. Make a pointPrimitive 50% translucent.
p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
获取或设定相机的距离,以禁用深度测试,例如防止对地形进行剪切.
当设定为零时,总是应用深度测试. 当设定为 Number.POSITIVE_INFINITY 时,深度测试从未应用.
-
Default Value:
0.0
distanceDisplayCondition : DistanceDisplayCondition
获取或设置条件, 指定此点将显示在相机的距离 .
-
Default Value:
undefined
选择点时获取或设定用户定义的值.
outlineColor : Color
获取或设置点的轮廓颜色.
获取或设置像素中的大纲宽度。 这个宽度增加了像素Size,
增加点的总大小.
获取或设置点的内大小以像素表示.
position : Cartesian3
获取或设定此点的笛卡尔位置.
scaleByDistance : NearFarScalar
根据点与相机的距离,获取或设定一个点的近远缩放属性.
A point's scale 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.
在这些范围之外,点的尺度仍然被限制在最接近的界限内。 本比额表
乘以像素Size和外观Width,以影响点的总大小. 如果未定义,
缩放ByDistance 将被禁用.
Examples:
// Example 1.
// Set a pointPrimitive's scaleByDistance to scale to 15 when the
// camera is 1500 meters from the pointPrimitive and disappear as
// the camera distance approaches 8.0e6 meters.
p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
// Example 2.
// disable scaling by distance
p.scaleByDistance = undefined;
确定是否显示此点。 使用这个来隐藏或显示点, 相反
将其删除并重新添加到收藏中.
splitDirection : SplitDirection
适用于此点的
SplitDirection .
-
Default Value:
SplitDirection.NONE
translucencyByDistance : NearFarScalar
根据点与相机的距离,获取或设置一个点的近和远透明特性.
A point's 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.
在这些范围之外,该点的透明度仍被限制在最接近的界限上。 如果未定义,
半透明ByDistance将被禁用 .
Examples:
// Example 1.
// Set a point's translucency to 1.0 when the
// camera is 1500 meters from the point and disappear as
// the camera distance approaches 8.0e6 meters.
p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
// Example 2.
// disable translucency by distance
p.translucencyByDistance = undefined;
Methods
computeScreenSpacePosition(scene, result) → Cartesian2
计算点源的屏幕-空间位置.
屏幕空间源是画布的顶端,左角; NT 0 x NT 1 从
左到右,和 NT 0 Y NT 1 从上到下增加.
| Name | Type | Description |
|---|---|---|
scene |
Scene | The scene. |
result |
Cartesian2 | optional 存储结果的对象 . |
Returns:
该点的屏幕-空间位置.
Throws:
-
DeveloperError : PointPrimitive must be in a collection.
Example:
console.log(p.computeScreenSpacePosition(scene).toString());
确定此点是否等于另一个点。 如果所有属性的点是相等的
平等无边. 不同集合中的点数可以相等.
| Name | Type | Description |
|---|---|---|
other |
PointPrimitive | optional 以平等为比较之理. |
Returns:
如果积分相等,则使用#NT#0 真 NT 1 ;否则, NT 2 假 NT 3 .