<sk-sphere-points-source>

← prev index next →

Scatters clones evenly over the surface of a sphere using a Fibonacci spiral — the way to spread copies across a ball with near-uniform spacing and no pole clustering.

Remarks

This is the sphere-surface member of the points-source family: a points-source defines the set of positions at which a sk-cloner places copies of its content, so it lives as a child of a <sk-cloner> and the cloner's other child is the template that gets cloned at each point. Because the positions are generated procedurally in the shader (see ShaderFunctionPointsSource), a million-point sphere costs the same handful of parameters as a hundred-point one.

Key attributes. count sets how many points are placed on the surface — the total clone count. radius sets the sphere's size; the points sit on that spherical shell. center offsets the sphere from the origin (defaults to the origin). distribution selects the placement algorithm — fibonacci (the only value, and the default) uses the golden-angle spiral, which gives the most even coverage and avoids the crowding at the poles that a latitude/longitude grid produces.

Related. For a UV (latitude/longitude) sphere — regular rings and the option of a single hemisphere — use sk-uv-sphere-points-source; for a geodesic subdivision use sk-platonic-sphere-points-source. Other closed surfaces include sk-cube-points-source, sk-capsule-points-source, and sk-torus-points-source; sk-grid-points-source fills a volume instead. To scatter over an arbitrary object's surface rather than an analytic shape, see sk-mesh-surface-points-source. Its host is always a sk-cloner.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
countrequired <number> 1 Number of points on the sphere surface.
radius <number> 1.0 Sphere radius.
center <3d-position> ([<number>, <number>, <number>]) [0, 0, 0] Sphere center position.
distribution <sphere-distribution> ("fibonacci") "fibonacci" Distribution method for points on the sphere.