/* example use of pmap_poly to infer projective mapping from a quadrilateral */ #include "poly.h" #define SIZE 50 main() { static poly p = { 4, /* u v sx sy */ {0, 0, 0, 0}, /* vert[0] */ {1, 0, 40, 0}, /* vert[1] */ {1, 1, 30, 30}, /* vert[2] */ {0, 1, 10, 20} /* vert[3] */ }; double ST[3][3]; double scr[3], tex[3]; int x, y; /* compute screen to texture transform ST */ pmap_poly(&p, ST); /* scan a square area of screen space, transforming to texture space */ for (y=0; y

AltStyle によって変換されたページ (->オリジナル) /