TerrainChunk
Description
Full source code is included in the Tinman 3D SDK download. |
Provides information about a terrain mesh chunk.
- See also
Public / Attributes
HeightmapCoordinates
The transformation matrix texture coordinates for unique texturing to cubemap heightmap coordinates (see Cubemap) relative to the maximum size (see MappingUtil.MaxSize)).
MaterialCoordinates
The transformation matrix from the local coordinate system of the terrain mesh chunk to texture coordinates for material-based texturing.
TerrainCoordinates
The transformation matrix from the local coordinate system of the given terrain mesh chunk to the terrain coordinate system.
The local coordinate system of a terrain mesh chunk is defined as follows:
-
X+
Aligned with terrain side-vector at the given coordinates.
side = cross(up, north)
.
The side vector points westwards for CartesianHandedness.RightHanded and eastwards for CartesianHandedness.LeftHanded. -
Y+
Aligned with terrain up-vector at the given coordinates. -
Z+
Perpendicular to side-vector and up-vector, pointing northwards. -
The coordinate origin is near to the center of the pyramid tile, but does not necessarily coincide with it.
TextureCoordinates
The transformation matrix from the local coordinate system of the terrain mesh chunk to approximated texture coordinates for unique texturing.
The matrix transforms a point (X,Y,Z)
in the local coordinate system into a point (U,E,V)
in the unit-cube, where U
and V
are the approximated texture coordinates (suitable for rendering, potentially unsuited for accurate geo-referencing) and E
represents the relative elevation (0
for minimum possible elevation, 1
for maximum possible elevation).