cylinder

fun Canvas.cylinder(x: Int, y: Int, z: Int, radiusTop: Float, radiusBottom: Float = radiusTop, height: Float, color: Color = Color.BLACK)

Draws a cylinder's wires in 3D space.

Parameters

x

The X coordinate of the cylinder center.

y

The Y coordinate of the cylinder center.

z

The Z coordinate of the cylinder center.

radiusTop

The radius of the top base of the cylinder.

radiusBottom

The radius of the bottom base of the cylinder. Defaults to radiusTop.

height

The height of the cylinder.

color

The color of the cylinder wires.


fun Canvas.cylinder(x: Int, y: Int, z: Int, radius: Float, height: Float, color: Color = Color.BLACK)

Draws a cylinder's wires in 3D space.

Parameters

x

The X coordinate of the cylinder center.

y

The Y coordinate of the cylinder center.

z

The Z coordinate of the cylinder center.

radius

The radius of the cylinder.

height

The height of the cylinder.

color

The color of the cylinder wires.


fun Canvas.cylinder(x: Int, y: Int, z: Int, radiusTop: Float, radiusBottom: Float = radiusTop, height: Float, slices: Int = 8, color: Color = Color.BLACK)

Draws a cylinder's wires in 3D space.

Parameters

x

The X coordinate of the cylinder center.

y

The Y coordinate of the cylinder center.

z

The Z coordinate of the cylinder center.

radiusTop

The radius of the top base of the cylinder.

radiusBottom

The radius of the bottom base of the cylinder. Defaults to radiusTop.

height

The height of the cylinder.

slices

The number of slices to use for drawing. Defaults to 8. Increasing the number of slices will result in a smoother cylinder.

color

The color of the cylinder wires.


fun Canvas.cylinder(x1: Int, y1: Int, z1: Int, x2: Int, y2: Int, z2: Int, radiusTop: Float, radiusBottom: Float = radiusTop, sides: Int = 8, color: Color = Color.BLACK)

Draws a cylinder in 3D space with differing start and end points between bases.

Parameters

x1

The X coordinate of the starting point.

y1

The Y coordinate of the starting point.

z1

The Z coordinate of the starting point.

x2

The X coordinate of the ending point.

y2

The Y coordinate of the ending point.

z2

The Z coordinate of the ending point.

radiusTop

The radius of the top base of the cylinder.

radiusBottom

The radius of the bottom base of the cylinder. Defaults to radiusTop.

sides

The number of sides to use for drawing. Defaults to 8. Increasing the number of sides will result in a smoother cylinder.

color

The color of the cylinder.