<sk-platonic-sphere-points-source>

← prev index next →

Distributes points very evenly over a sphere by subdividing a platonic solid — the way to scatter copies of an object across a ball with near-uniform spacing (no clustering at the poles).

Remarks

This is a procedural member of the points-source family (see ShaderFunctionPointsSource): 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 cloned at each point. The points come from subdividing a platonic solid and projecting the result onto the sphere, so the coverage stays far more uniform than a latitude/longitude sk-uv-sphere-points-source — and, being generated in the shader, a densely subdivided sphere costs the same few parameters as a coarse one.

Key attributes. solid-type picks the seed polyhedron — tetrahedron (4 base points), octahedron (6), hexahedron (cube, 8), or icosahedron (12) — with icosahedron giving the most uniform triangle distribution and being the usual choice. subdivisions refines the seed: each step splits every triangle into four, so the point count grows sharply (leave at 0 for just the solid's own vertices; 23 gives a dense, smooth sphere). radius sets the sphere size and center its position.

Related. For a sphere addressed by rings and segments instead of even coverage, see sk-uv-sphere-points-source and the general sk-sphere-points-source; other procedural shapes include sk-grid-points-source, sk-disc-points-source, and sk-torus-points-source. For positions taken from data or another object rather than a formula, see sk-mesh-vertex-points-source, sk-mesh-surface-points-source, sk-buffer-points-source, and sk-cloner-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
solid-typeanimatable <platonic-solid> ("tetrahedron" | "hexahedron" | "octahedron" | "icosahedron") "icosahedron" Platonic solid type.
subdivisions <number> 0 Number of subdivision iterations.
radius <number> 1.0 Sphere radius.
center <3d-position> ([<number>, <number>, <number>]) [0, 0, 0] Sphere center position.