INNER CODE UNIT · C#
BlGeometry
Blotch3D/Blotch3D · src/BlGeometry.cs:23
public class BlGeometry
{
// used to generate noise
static Random Rand = new Random();
/// <summary>
/// Creates a square 1x1 surface in XY but with variation of its Z depending on the pixels in an image (heightfield).
/// A maximum pixel value (according to numSignificantBits) causes the corresponding position on the surface to have
/// a height of 1. Use TransformVertices to alter this.
/// Returns a triangle array of the surface, which includes smooth normals and texture coordinates.
/// </summary>
/// <param name="tex">The texture that represents the height (Z) of each vertex.</param>
/// <param name="mirrorY">If true, then invert image's Y dimension</param>
/// <param name="smooth">Whether to apply a 3x3 gaussian smoothing kernel, or not</param>
/// <param name="noiseLevel">How much noise to add. If it's Double.NaN, then automatically calculate a little
/// noise to overcome quantization from limited numSignificantBits</param>
/// <param name="numSignificantBits">How many bits in a pixel should be used (starting from the least significant bit).
/// Normally the first 8 bits are used (the last channel), but special images might combine the bits of multiple