Flash player version 10+ native drawTriangles() method is perfect for programming homography (2D transformation that preserves lines) because of its support for UVT data. In general case, however, homography requires solving 8×8 linear equations system, so noone can be arsed to code that. Instead they implement one of two special cases – mapping rectangle to or from quadrilateral. So far, only 1st case was implemented using drawTriangles, while 2nd case was done using filters. Well, no longer so – it turned out, inverting T values in Zeh code was sufficient to make it work backwards:
One interesting thing about this code is that noone really knows exactly how it works :) I didn’t have to study all the math behind Zeh code in order to “invert” it, and Zeh… well, let me quote:
I was lucky enough to get what I wanted working after a good amount of crazy trial and error (and beer)
Cool experiment!
Nive one !
That should be very helpful in FlarToolkit right ?
Who knows. I never checked how do they compare quadrilaterals to marker reference data, probably a bunch of getPixel calls. Can’t be too slow, 8×8 grid means only 64 of them.
why is there no sound?
turn on your speakers
Thats pretty neat. I completely forgot you could use drawTriangles to do this.
Ok, it was a while ago, but I’m very interested in the code of this. What exactly do you mean with “inverting T values”? Could you share your source?
Thanks a lot,
I mean T-s in UVT array that flash’s drawTriangles() method takes. The picture in the post is clickable (and takes you straight to the source).
I love clickable pictures. Thanks again.