The main class for styling mesh data is MeshStyle. It allows you to define several expressions to visualize, filter and alter your dataset:

  • colorExpression: create an expression to determine the color of your mesh. A color expression overrides any texture color in the dataset.

  • selectedColorExpression: create an expression to determine the color for parts of your mesh that are selected. See Selecting mesh data for more information.

  • visibilityExpression: create an expression to make meshes partially or fully visible or invisible based on available attributes and parameters.

  • displacementExpression: create an expression to partially or fully displace meshes based on available attributes and parameters.

You must use ExpressionFactory to create the styling expressions. See Property-based styling and filtering of points on a WebGLMap for more information about styling by means of expressions. See the MeshStyle API reference documentation for example code.

In addition, you can use MeshStyle to manipulate the lighting of the mesh data. Use lighting to pass a boolean value that indicates whether the dataset is affected by the lighting effect applied to the map. The default value is true. For more information about map lighting, see Configuring WebGL Map effects.

Program: Using a mesh style.
import {color, defaultColor, multiply} from "@luciad/ria/util/expression/ExpressionFactory";
import {OGC3DTilesModel} from "@luciad/ria/model/tileset/OGC3DTilesModel";
import {TileSet3DLayer} from "@luciad/ria/view/tileset/TileSet3DLayer";

layer.meshStyle = {
  selectedColorExpression: multiply(color("rgb(255,148,76)"), defaultColor()),
  lighting: false