Sphere

fun FilamentSceneScope.Sphere(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), radius: Float = 0.5f, rings: Int = 16, segments: Int = 32, onCreate: (Entity) -> Unit = {})

A UV sphere centered on the origin. rings is the latitudinal count (from pole to pole), segments is the longitudinal count. Higher counts → smoother sphere, more triangles (rings * segments * 2 triangles total).

Parameters

material

The material applied to the whole sphere.

position

World-space position of the pivot point.

rotation

World-space rotation.

scale

Per-axis scale.

pivot

Point in mesh space that rotation/scale revolve around. Defaults to the sphere centre.

radius

Sphere radius in mesh space.

rings

Latitude subdivisions. Minimum 2.

segments

Longitude subdivisions. Minimum 3.

onCreate

Receives the renderable entity ID once the sphere is added to the scene.