Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

instances.transform (procNode)

Rigidly transform a population: the point layout is moved, turned and scaled, and the same rotation and scale are composed into every instance's own orient and scale, so a field of copies moves the way one rigid object would. Points p become translate + scale * R * p, with R = Rz * Ry * Rx about the world origin. Points that carry no orient or scale are taken as unrotated and at full size.

Inputs

  • instances (Points). The set to move as one piece: the layout and each instance's own transform travel together.
  • translate (Vec3, default (0, 0, 0)). Where the whole layout is carried to, added to every point after the rotation and the scale.
  • rotate (Vec3, default (0, 0, 0)). Degrees about X, Y and Z, applied in that order about the world origin. It swings the point layout around the origin and turns each instance by the same amount.
  • scale (Float, default 1). One factor for the whole set: it multiplies each point's distance from the world origin and every instance's own size.

Outputs

  • instances (Points). The moved set.
local rocks = g.instances.on_points({ source = g.mesh.box({}), points = g.points.grid({ countX = 2, countZ = 2, spacing = 3 }) })
local turned = g.instances.transform({ instances = rocks, rotate = vector.create(0, 90, 0), scale = 0.5 })