An expression to specify what colors to apply to mesh data.
To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a color value. If you want to update the styling very often, consider using parameters in your expression. Changing the values of parameters is more efficient than replacing the whole expression. If you define a colorExpression, the texture data, if any, will not be displayed. The color expression will determine the color. Note that the alpha component of the color is ignored so the color will be fully opaque, unless you enable transparency.An expression to displace mesh data.
To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a point value.If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.
// Example of a displacement expression that pushes down everything inside a shape.
var _ = ExpressionFactory;
var shape = _.orientedBox(layer.orientedBox);
meshStyle.displacementExpression = _.pushDown(shape);
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:
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
meshStyle.facetCulling = FacetCullingType.BACKFACE_CULLING;
Boolean indicating whether lighting effects should be applied to the mesh.
The map allows you to apply graphics effects. This boolean indicates whether the lighting graphical effects should be applied to meshes styled with this style.Configures the PBR shading effects applied to the mesh.
An expression to specify what colors to apply to selected mesh data.
To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a color value. This value can also be set to null to prevent selection from changing the color. If you want to update the styling very often, consider using parameters in your expression. Changing the values of parameters is more efficient than replacing the whole expression. If you define a selectedColorExpression, the texture data, if any, will not be displayed while selection is active for the selected part of the mesh. The color expression will determine the color.import {color, defaultColor, multiply} from "@luciad/ria/util/expression/ExpressionFactory.js";
import {OGC3DTilesModel} from "@luciad/ria/model/tileset/OGC3DTilesModel.js";
import {TileSet3DLayer} from "@luciad/ria/view/tileset/TileSet3DLayer.js";
layer.meshStyle = {
selectedColorExpression: multiply(color("rgb(255,148,76)"), defaultColor()),
lighting: false
};
Note that the alpha component of the color is ignored so the selection color will be fully opaque.
An expression to filter mesh data.
To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a boolean value.If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.
// Example of a visibility expression that makes everything inside a shape invisible.
var _ = ExpressionFactory;
var shape = _.orientedBox(layer.orientedBox);
meshStyle.visibilityExpression = _.not(_.isInside(shape));
This is the general interface that describes a Mesh style object.
2019.0