TextureDecal
Description
- Derived from
A scene entity that puts a decal onto the terrain.
The following figured shows the mapping between decal vertex coordinates and decal texture coordinates.
(A)---------(B) Vertex Texture | | coordinates: coordinates: | | A := (-0.5, -0.5) (0, 0) | | B := (+0.5, -0.5) (1, 0) | | C := (+0.5, +0.5) (1, 1) | | D := (-0.5, +0.5) (0, 1) (D)---------(C)
The decal vertex transformation is defined as follows:
-
The input decal vertex coordinates
v_in
are translated according to the decal texture center (see Center), so that subsequent scaling and rotation is relative to the decal texture center.
v := v_in - Center + (0.5, 0.5)
-
The decal vertex coordinates
v
are scaled, according to Scale:
v := v * Scale -
The decal vertex coordinates
v
are rotated, according to Yaw:
v := RotateClockwiseRightHanded(v, Yaw) -
The output decal vertex coordinates
v_out
result from applying the final offset translation, according to Offset:
v_out := v + Offset
The resulting vertex coordinates are used as map coordinates with respect to the specified coordinate system (see Coordinates). From there, the decal texture is put onto the terrain at the corresponding position.
The default value for the ILightingProperty.Lighting property is false
.
- See also
Public / Attributes
Center
The texture coordinates that represent the center of the decal texture.
The scaling (see Scale) and rotation (see Yaw) of the decal texture is applied relative to this center.
Defaults to (0.5, 0.5).
- See also
Matrix
Returns the homogeneous transformation matrix from input decal vertex coordinates to output decal vertex coordinates.
Offset
The translation offset of the decal vertex transformation.
The translation offset is added to the vertex coordinates of the decal texture, after applying scaling (see Scale) and rotation (see Yaw). Use it to move the decal texture center (see Center) to a desired point in map-space.
Defaults to Vec2D.Zero.
- See also
Scale
The scale factors per axis of the decal vertex transformation.
Scaling is applied relative to the decal texture center (see Center).
The texture coordinates for the horizontal U
and vertical V
axis of the given decal texture (see Content) are within the range [0..1], where 0 represents the left resp. top edge and 1 represents the right resp. bottom edge. The Vec2D.X resp. Vec2D.Y scale factor transforms the range [0..1] to map space, as defined by the specified coordinate system (see Coordinates).
Defaults to Vec2D.Zero.
- See also
Yaw
The rotation angle of the decal vertex transformation.
The rotation is applied relative to the decal texture center (see Center). Positive angles rotate clockwise for right-handed map-space and counter-clockwise for left-handed map-space.
Defaults to 0
.
- See also