/* example use of pmap_param to compute parameterization of a polygon */ #include "poly.h" main() { static poly p = { 4, /* u v sx sy x y z */ {0, 0, 0, 0, 4, 2, 6}, /* vert[0] */ {1, 0, 40, 0, 5, 3, 8}, /* vert[1] */ {1, 1, 30, 30, 5, 7,12}, /* vert[2] */ {0, 1, 10, 20, 4, 6,10} /* vert[3] */ /* * note: sx and sy are ignored, * This test polygon is a square in texture space (u,v) * and a planar parallelogram in object space (x,y,z) */ }; double TO[3][4]; double obj[4], u, v; int i; /* compute texture to object transform TO */ pmap_param(&p, TO); for (i=0; i