Icon3DStyle that requires a URL to retrieve a 3D mesh.

Hierarchy

Properties

bloom?: BloomStyle

Adds a BloomEffect to the 3D icon.

Bloom is only supported on WebGL maps.

Since

2022.1

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);
};
credentials?: boolean

Whether credentials should be included with every HTTP request.

facetCulling?: FacetCullingType

This setting determines which side of the surfaces (facets) that make up a mesh are omitted (culled) from the rendering result.

When rendering meshes, all surfaces that make up the mesh face a certain direction. This direction is often called the normal direction. This normal is used to determine if the surface is being seen from the front or the back. When rendering objects that have no holes in them, it is only possible to see the front of all surfaces. Graphics pipelines therefore often don't render the back sides of those surfaces to speed up rendering.

Apart from performance, some applications are made possible by enabling back-face culling. Consider for example a mesh that represents a room. Its normals would all point to the inside of the room. When enabling back-face culling, you can see the walls and floor of the room, without having to move the camera inside the room itself.

In some cases however, enabling back-face culling (i.e. not rendering the back-side of surfaces) can have undesired artifacts. This can for example happen:

  • for objects with incorrect normals. In that case, you will for example only see the inside of a mesh instead of the outside
  • for objects with holes in them. In that case, you won't be able to see the inside of the mesh, even when looking through the hole

Both can be resolved by disabling culling.

By default, no culling takes place and both sides of a surface are painted.

  // Example of enabling backface culling
iconStyle.facetCulling = FacetCullingType.BACKFACE_CULLING;

Default

<code>FacetCullingType.NO_CULLING</code>

Since

2023.1

legacyAxis?: boolean

In LuciadRIA 2023.1 the axis directions were changed. This flag was added for compatibility reasons.

This flag sets whether to use the legacy (< 2023.1) axis system (true) or Z-up (false) axis system. For maps with a cartesian reference, this flag is ignored and the Z-up axis system is used. For all other references, this flag is true by default.

When this flag is enabled, the axis system will behave as it did in LuciadRIA 2023.0: GLTF meshes will have their forward vector face up, and their down vector face east. The XYZ coordinates of custom meshes are interpreted as North, West, and Up respectively. Rotations for all meshes are counterclockwise as seen from these directions.

When legacy axis is disabled, GLTF meshes will be rotated such that their forward vector faces north, and their down vector faces down. The XYZ coordinates of custom meshes are interpreted as East, North, and Up respectively. Rotations for all meshes are counterclockwise as seen from these directions.

Warning: Starting from LuciadRIA 2024.0 the default value for this flag will be false. It is already recommended to set this flag to false in your application. For more information, see Howto: Visualizing 3D icons.

Default

<code>true</code>

Since

2023.1

meshUrl: string

A URL referring to a mesh resource. For example http://www.example.com/mesh.gltf.

Currently only the GLTF format is supported.

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 orientation is applied as roll first, then pitch and lastly heading.

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

    The angle wrt. the north direction. A value of 0 points the 3D icon towards the North pole. The angle increases in clockwise direction, , e.g. +90 points the 3D icon to the east. For 3D cartesian references, the y-direction serves as the north direction.

  • Optional pitch?: number

    The angle wrt. the horizon (aka. "tilt"). A value of 0 points the 3D icon towards the horizon (i.e. horizontally). -90 points the 3D icon straight down towards the ground and +90 points the 3D icon straight up, towards the sky. For 3D cartesian references, -90 points the 3D icon in the negative z direction and +90 points it in the positive z direction.

  • Optional roll?: number

    A rotation around the 3D icon's forward direction (aka "bank"). Negative angles bank the 3D icon left; positive angles bank the 3D icon right.

pbrSettings?: null | PBRSettings

Configures the PBR shading effects applied to the mesh.

Default

<code>null</code>

Since

2021.1

requestHeaders?: null | HttpRequestHeaders

An object literal that represents headers (as a key-value map) to send with each HTTP request. If set (and not empty), an XHR with the specified headers will be performed instead of creating an Image.

requestParameters?: null | HttpRequestParameters

An object literal that represents URL parameters (as a key-value map) to send with each HTTP request. If set (and not empty), an XHR with the specified query parameters will be performed instead of creating an Image.

Since

2021.0

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.

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.

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.

transparency?: boolean

Indicates whether transparent surfaces should be painted transparently.

A transparent surface is a surface with either a color or a texture with an alpha channel value lower than 1. The transparency of a surface is not auto-detected.

If you set this property to true, LuciadRIA considers the mesh to have transparent surfaces, and renders it as such. If you set it to false, there is no guarantee that LuciadRIA renders the transparent surfaces of the mesh properly. For example, if you set transparency to false for this jet with a transparent cockpit, it has a see-through hole where the cockpit should be:

Transparency set to false Transparency set to true
Transparency Off Transparency On

Note that setting this flag to true might affect performance. Use it for meshes with transparent surfaces only. Drawing a mesh with the transparency flag enabled comes at a cost. It amounts to drawing the mesh twice.

This setting only applies to 3D maps.

Default

<code>false</code>

Since

2022.0

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.