Skip to content

anim-format (runtime format) / cardHomography

Function: cardHomography() ​

ts
function cardHomography(
   pose, 
   proj, 
   space?, 
   size?
): 
  | {
  back: boolean;
  h: number[];
}
  | null;

A card's homography in parent space (flat parent position → projected parent position) from 4 points around its turning point, size apart. Plane → plane perspective maps are exactly homographies, so 4 points fix it everywhere. Also tells whether the viewer sees the back.

Parameters ​

ParameterTypeDefault value
poseCardPoseundefined
projProjectionundefined
space?Matrix2DFLAT
size?number100

Returns ​

| { back: boolean; h: number[]; } | null

HereSplash — 2D animation for the web