Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: VertexInfo[][] Texturize(this VertexInfo[][], double, double)

  • Declared in: RT.Modeling.Md

Declaration

public static VertexInfo[][] Texturize(
    this VertexInfo[][] model,
    double baseY,
    double rMult
)

Summary

Applies texture coordinates (UV mapping) to a model by determining the maximum extent along the x- and z-axis and then optionally stretching/shrinking the space according to the y-coordinate.

Parameters

this VertexInfo[][]model The model to process.
doublebaseY The y-coordinate at which the UV coordinates should match the maximum x/z extent of the vertices.
doublerMult The amount by which a Y-coordinate’s deviation from baseY should cause the UV coordinates to stretch/shrink. Specify 0 (zero) to prevent stretching/shrinking (straight rectilinear projection).

Returns

The same model but with texture coordinates applied.

Remarks

This method assumes that you want to project the texture down the y-coordinate. To use any other projection direction, rotate the model to align with the y-axis first, then apply Md.Texturize(this VertexInfo[][], double, double), then rotate it back.