fillSphere

fun Canvas.fillSphere(x: Int, y: Int, z: Int, radius: Float, color: Color)

Draws a sphere in 3D space.

Parameters

x

The X coordinate of the sphere center.

y

The Y coordinate of the sphere center.

z

The Z coordinate of the sphere center.

radius

The radius of the sphere.

color

The color of the sphere.


fun Canvas.fillSphere(x: Int, y: Int, z: Int, radius: Float, rings: Int = 8, slices: Int = 8, color: Color = Color.BLACK)

Draws a sphere in 3D space.

Parameters

x

The X coordinate of the sphere center.

y

The Y coordinate of the sphere center.

z

The Z coordinate of the sphere center.

radius

The radius of the sphere.

rings

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

slices

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

color

The color of the sphere.