Programming API Reference: SharpGfx.Geometries.Shapes

Class public static Patch

A square surface as a function of (x, z). Approach with indexing.

Method public static (float[] positions ushort[] triangles) Get()

Returns the surface.
  • int nx: number of sub-patches in x-axis direction.
  • int nz: number of sub-patches in y-axis direction.
  • Func<float float float> y: height in y-axis-direction for any given point on the patch.

Method public static float[] GetTextureUvs()

Returns (u, v) for all vertices.
  • int nx: number of sub-patches in x-axis direction.
  • int nz: number of sub-patches in y-axis direction.