Click or drag to resize
DigitalRuneGeometryHelperCreateIcosphere Method
Creates a sphere (or hemisphere) by successively subdividing an icosahedron.

Namespace: DigitalRune.Geometry
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public static TriangleMesh CreateIcosphere(
	int subdivisions,
	bool hemisphere
)

Parameters

subdivisions
Type: SystemInt32
The number of subdivisions. See remarks.
hemisphere
Type: SystemBoolean
If set to only the upper half (positive y) of the sphere is created; otherwise, the full sphere is created.

Return Value

Type: TriangleMesh
The triangle mesh of the sphere (or hemisphere).
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionsubdivisions is negative.
ArgumentExceptionhemisphere is , but subdivisions is less than 1. At least 1 subdivision is required to create a hemisphere.
Remarks

The resulting triangles use counter-clockwise vertex order. The triangles face outward, i.e. when looking at a triangle from the outside its vertices are ordered counter-clockwise.

A minimum of 1 subdivision is required to create hemisphere. If you plan to render the mesh using a 16-bit index buffer then the max number of subdivisions is 5!

  • 0 subdivisions: 20 triangles
  • 1 subdivisions: 240 triangles
  • 2 subdivisions: 320 triangles
  • 3 subdivisions: 1280 triangles
  • 4 subdivisions: 5120 triangles
  • 5 subdivisions: 20480 triangles
  • 6 subdivisions: 81920 triangles
  • 7 subdivisions: ...

See Also