capMesh

fun capMesh(sides: Int, radius: Double, envelope: List<Vector2> = listOf( Vector2(0.0, 0.0), Vector2(1.0, 0.0) )): VertexBuffer(source)

A shape created by rotating an envelope around a vertical axis.

Return

A vertex buffer containing the triangles to render the 3D shape

Parameters

sides

the angular resolution of the cap

radius

the radius of the cap

envelope

a list of points defining the profile of the cap. The default envelope is a horizontal line which produces a flat round disk. By providing a more complex envelope one can create curved shapes like a bowl.