Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

points.disc (procNode)

Points scattered in a disc on the XZ plane, optionally domed into a mound. Use it for piles, puddles of debris and ground scatter.

Draws on channels 0 to 3 of the points scope: radius, angle, dome height and jitter. A point's distance from the centre is radius * sqrt(draw0), so the disc is evenly dense to its rim.

Built from: rand.unit, core.points, math.*.

Inputs

  • count (Float, default 64, at least 0). How many points to draw. Each is placed on its own draw, so raising this fills the same disc denser rather than changing the layout of the ones already there.
  • radius (Float, default 1). Radius of the disc the points fall in. The draw takes the square root of a uniform number, so density per unit area is even out to the rim.
  • height (Float, default 0). Peak of the dome at the centre. A point's y is this times (1 - (r/radius)^2) times its own draw in [0, 1). 0 leaves every point on the plane.
  • jitter (Float, default 0). Vertical noise added to each point's y, drawn evenly across the full band of this width centred on zero.
  • seed (Float, default 1). Picks where the points land: one seed draws the same cloud on every run, machine and platform.

Outputs

  • points (Points). count points carrying P and id.
local pile = g.points.disc({ count = 200, radius = 3, height = 1.2 })