Matrix4d.trapezoidCrop

Set <code>this</code> matrix to a perspective transformation that maps the trapezoid spanned by the four corner coordinates <code>(p0x, p0y)</code>, <code>(p1x, p1y)</code>, <code>(p2x, p2y)</code> and <code>(p3x, p3y)</code> to the unit square <code>[(-1, -1)..(+1, +1)]</code>. <p> The corner coordinates are given in counter-clockwise order starting from the <i>left</i> corner on the smaller parallel side of the trapezoid seen when looking at the trapezoid oriented with its shorter parallel edge at the bottom and its longer parallel edge at the top. <p> Reference: <a href="http://www.comp.nus.edu.sg/~tants/tsm/TSM_recipe.html">Trapezoidal Shadow Maps (TSM) - Recipe</a>

@param p0x the x coordinate of the left corner at the shorter edge of the trapezoid @param p0y the y coordinate of the left corner at the shorter edge of the trapezoid @param p1x the x coordinate of the right corner at the shorter edge of the trapezoid @param p1y the y coordinate of the right corner at the shorter edge of the trapezoid @param p2x the x coordinate of the right corner at the longer edge of the trapezoid @param p2y the y coordinate of the right corner at the longer edge of the trapezoid @param p3x the x coordinate of the left corner at the longer edge of the trapezoid @param p3y the y coordinate of the left corner at the longer edge of the trapezoid @return this

struct Matrix4d
ref return
trapezoidCrop
(
double p0x
,
double p0y
,
double p1x
,
double p1y
,
double p2x
,
double p2y
,
double p3x
,
double p3y
)

Meta