| GeometryHelperCreateIcosphere Method |
Creates a sphere (or hemisphere) by successively subdividing an icosahedron.
Namespace: DigitalRune.GeometryAssembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax public static TriangleMesh CreateIcosphere(
int subdivisions,
bool hemisphere
)
Public Shared Function CreateIcosphere (
subdivisions As Integer,
hemisphere As Boolean
) As TriangleMesh
public:
static TriangleMesh^ CreateIcosphere(
int subdivisions,
bool hemisphere
)
static member CreateIcosphere :
subdivisions : int *
hemisphere : bool -> TriangleMesh
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:
TriangleMeshThe triangle mesh of the sphere (or hemisphere).
Exceptions 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