perspective

Tilt the child in 3D, as if it were a card turned away from the camera.

perspective(slots: {
    center: ArgSpec
    pan: ArgSpec
    tilt: ArgSpec
    fov: ArgSpec
    zoom: ArgSpec
    offset: ArgSpec
}): UvMapSource

Import warps from shaders/std and use warps.perspective.

pan and tilt are the turns in degrees (−90 to 90). fov is the camera's field of view in degrees: wider means stronger perspective. zoom scales the picture (1 is unchanged). center is the pivot and offset shifts the result, both in uv.

Parameters

NameTypeNotes
slots`{
center: ArgSpec
pan: ArgSpec
tilt: ArgSpec
fov: ArgSpec
zoom: ArgSpec
offset: ArgSpec

}` | |

Example

map: warps.perspective({center: p('center'), pan: p('pan'), tilt: p('tilt'), fov: p('fov'), zoom: p('zoom'), offset: p('offset')})

See also

  • cornerPin — Pin the four corners of the child to new positions, with true perspective between them.
  • bend — Curve the child like a bent sheet seen in perspective, so its ends swell or shrink.

Used by

Perspective