Click or drag to resize
Ab4d.SharpEngine logo

MeshFactoryCreateIcosphereMesh Method

CreateIcosphereMesh creates a StandardMesh that represents 3D sphere that consists of equally sized triangles. The number of created triangles is defined by the subdivisions parameter (default value 3 creates 642 positions and 1280 triangles).

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 5.0.1075+bc537c8d217949260b11f66ee86aefa6456ac517
Syntax
C#
public static StandardMesh CreateIcosphereMesh(
	Vector3 centerPosition,
	float radius,
	int subdivisions = 3,
	bool createTextureCoordinates = true,
	string? name = null
)

Parameters

centerPosition  Vector3
center of the sphere
radius  Single
radius of the sphere
subdivisions  Int32  (Optional)
Gets or sets the number of times the initial (12 positions, 20 triangles) Icosphere is subdivided. Some examples: 2 (162 positions, 320 triangles); 3 (642 positions, 1280 triangles); 4 (2562 positions, 5120 triangles). This value must be between 0 and 8.
createTextureCoordinates  Boolean  (Optional)
when true (by default), then the texture coordinates are also generated (this requires duplicating some positions and using a slower code path). When false, all TextureCoordinate values are set to (0, 0).
name  String  (Optional)
optional name for the mesh

Return Value

StandardMesh
StandardMesh with filled vertices array and index array
See Also