Skip to content

anim-format (runtime format) / unwarpPoint

Function: unwarpPoint() ​

ts
function unwarpPoint(
   rest, 
   deform, 
   tris, 
   x, 
   y
): 
  | {
  x: number;
  y: number;
}
  | null;

a point as drawn (warped space) → the point of the flat picture it shows (rest space); null = outside the warped mesh

Parameters ​

ParameterType
restreadonly number[]
deformreadonly number[] | null | undefined
trisreadonly number[]
xnumber
ynumber

Returns ​

| { x: number; y: number; } | null

HereSplash — 2D animation for the web