new SuperMap3D.DistanceDisplayConditionGeometryInstanceAttribute(near, far)

Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
Name Type Default Description
near Number 0.0 optional The near distance.
far Number Number.MAX_VALUE optional The far distance.
var instance = new SuperMap3D.GeometryInstance({
  geometry : new SuperMap3D.BoxGeometry({
    vertexFormat : SuperMap3D.VertexFormat.POSITION_AND_NORMAL,
    minimum : new SuperMap3D.Cartesian3(-250000.0, -250000.0, -250000.0),
    maximum : new SuperMap3D.Cartesian3(250000.0, 250000.0, 250000.0)
  modelMatrix : SuperMap3D.Matrix4.multiplyByTranslation(SuperMap3D.Transforms.eastNorthUpToFixedFrame(
    SuperMap3D.Cartesian3.fromDegrees(-75.59777, 40.03883)), new SuperMap3D.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap3D.Matrix4()),
  id : 'box',
  attributes : {
    show : new SuperMap3D.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)


readonlycomponentDatatype : ComponentDatatype

The datatype of each component in the attribute, e.g., individual elements in DistanceDisplayConditionGeometryInstanceAttribute#value.
Default Value: ComponentDatatype.FLOAT

readonlycomponentsPerAttribute : Number

The number of components in the attributes, i.e., DistanceDisplayConditionGeometryInstanceAttribute#value.
Default Value: 3

readonlynormalize : Boolean

When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
Default Value: false

value : Float32Array

The values for the attributes stored in a typed array.
Default Value: [0.0, 0.0, Number.MAX_VALUE]



Creates a new DistanceDisplayConditionGeometryInstanceAttribute instance given the provided an enabled flag and DistanceDisplayCondition.
Name Type Description
distanceDisplayCondition DistanceDisplayCondition The distance display condition.
  • DeveloperError : distanceDisplayCondition.far must be greater than distanceDisplayCondition.near
var instance = new SuperMap3D.GeometryInstance({
  geometry : geometry,
  attributes : {
    color : SuperMap3D.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition),

staticSuperMap3D.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, result)Float32Array

Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
Name Type Description
distanceDisplayCondition DistanceDisplayCondition The distance display condition value.
result Float32Array optional The array to store the result in, if undefined a new instance will be created.
The modified result parameter or a new instance if result was undefined.
var attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.distanceDisplayCondition = SuperMap3D.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);