Options
All
  • Public
  • Public/Protected
  • All
Menu

Base properties of a Icon3DStyle.

Hierarchy

Overview

Properties

Optional color

color: string

The color of the mesh. For example "rgb(125, 125, 125)" or "rgba(125, 125, 125, 0.5)".

The default for this value is opaque white: rgba(255,255,255,1.0)

Note that if the mesh contains textures, this color will act as a modulation color. This can be useful for selection:

  painter.paintBody = function(geoCanvas, feature, shape, map, layer, state) {
     //Applying a selection style using modulation color
     var icon3DStyle = {
        meshUrl: "aircraft.gltf",
        color: state.selected ? "rgba(255,0,0,0.5)" : "rgba(255,255,255,1.0)"
     }
     geoCanvas.drawIcon3D(shape, icon3DStyle);
   };

Optional orientation

orientation: { heading?: number; pitch?: number; roll?: number }

Defines the orientation of a 3D icon. It can contain the following properties:

  • roll: A number defining the roll in degrees. Default value is 0 (parallel with earth).
  • pitch: A number defining the pitch in degrees. Default value is 0 (parallel with earth).
  • heading: A number defining the heading in degrees. Default value is 0 (north).

The difference between orientation and rotation is that orientation is defined in the world reference. Rotation on the other hand is defined in the local reference of the mesh.

You should use rotation to align the mesh to its axes, before it is added to the world.

You should use orientation to point the mesh in a certain world direction, after it has been added to the world.

   // The following example illustrates a plane rising upward with a pitch of 20 degrees against the horizon,
   // while heading west (270 degree azimuth).
  var orientation = {
    roll: 0,
    pitch: 20,
    heading: 270
  };

Type declaration

  • Optional heading?: number

    A number defining the heading in degrees, clockwise. Default value is 0 (north).

  • Optional pitch?: number

    A number defining the pitch in degrees, clockwise. Default value is 0 (parallel with earth).

  • Optional roll?: number

    A number defining the roll in degrees, clockwise. Default value is 0 (parallel with earth).

Optional rotation

rotation: { x?: number; y?: number; z?: number }

Defines the rotation angle in degrees around the various axes of the mesh in its local reference. Rotation happens around (0,0,0) in the local reference of the mesh.

By default the rotation is 0 for all axis. The rotation for any axis should be defined in degrees and be a positive floating point number between 0 and 360.

The difference between orientation and rotation is that orientation is defined in the world reference. Rotation on the other hand is defined in the local reference of the mesh.

You should use rotation to align the mesh to its axes, before it is added to the world.

You should use orientation to point the mesh in a certain world direction, after it has been added to the world.

  // Example of an orientation object with a 90 degrees rotation around the X-axis.
  var rotation = {
    x: 90,
    y: 0,
    z: 0
  };

Type declaration

  • Optional x?: number

    The rotation around the x-axis. Default is 0.

  • Optional y?: number

    The rotation around the y-axis. Default is 0.

  • Optional z?: number

    The rotation around the z-axis. Default is 0.

Optional scale

scale: { x?: number; y?: number; z?: number }

Defines the factor by which the 3D icon is scaled along the various axes of the mesh's local reference. Scale can be used to convert a mesh from its local unit-of-measure to meters. By default, we assume that a mesh is defined in meters. If this is not the case, scale can be used to enlarge or shrink the mesh to fit its own unit of measure.

By default the scale is 1 for all axis. Note that the scale must be a positive, non-zero floating point value.

  // Example of scaling an object by a factor of a 1000, to convert it from millimeters to meters.</caption>
  var scale = {
    x: 1000,
    y: 1000,
    z: 1000
  };

Type declaration

  • Optional x?: number

    The rotation for the x-axis. Default is 1.

  • Optional y?: number

    The rotation for the y-axis. Default is 1.

  • Optional z?: number

    The rotation for the z-axis. Default is 1.

Optional translation

translation: { x?: number; y?: number; z?: number }

Defines the distance by which coordinates are translated in the various axes direction of the mesh local reference. This property should be used to center a mesh to (0,0,0) in its own local cartesian reference. This allows you to set the anchorpoint of the mesh, which is useful when you want to rotate the mesh around a specific point.

By default the translation is 0 for all axis. The translation can be a negative, or positive floating point number.

   // Example of how to translate a mesh 1000 meters along the Z-axis.</caption>
  var translation = {
    x: 0,
    y: 0,
    z: 1000
  };

Type declaration

  • Optional x?: number

    The translation via the x-axis. Default is 0.

  • Optional y?: number

    The translation via the y-axis. Default is 0.

  • Optional z?: number

    The translation via the z-axis. Default is 0.

Optional zOrder

zOrder: number

The Z-order of this shape. Shapes will be painted from lowest to highest Z-order, so that shapes with a higher Z-order are painted on top of shapes with a lower Z-order. The default value is 0.

Note that the Z-order only has meaning in 2D.

By default the Z-order is 0.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method