Skip to content

anim-format (runtime format) / projectRect

Function: projectRect() ​

ts
function projectRect(
   pose, 
   proj, 
   rect, 
   space?
): number[] | null;

The 4 corners of a local rectangle, projected into parent space ([x0,y0, …]: top-left, top-right, bottom-right, bottom-left), or null when a corner is behind the eye.

Parameters ​

ParameterTypeDefault value
poseCardPoseundefined
projProjectionundefined
rect{ height: number; width: number; x: number; y: number; }undefined
rect.heightnumberundefined
rect.widthnumberundefined
rect.xnumberundefined
rect.ynumberundefined
space?Matrix2DFLAT

Returns ​

number[] | null

HereSplash — 2D animation for the web