Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With some fiddling in matrices this could also be done live in the browser as a CSS 3D transform using matrix3d or in a WebGL context on the iframe or video element.

Have no time to do the rectifying math on the components today but basically it would be some kind of inverse of this projective transformation:

http://franklinta.com/2014/09/08/computing-css-matrix3d-tran...

quick non-inverse transformation adapted from http://math.stackexchange.com/a/339033/70086

http://jsfiddle.net/w4bkmeaq/



The math for working out the transform is actually the same (not an inverse!) since you are still just trying to map 4 points to 4 points.

I had a demo for the 'inverse' transform also: http://codepen.io/fta/pen/LHonf

Here is the same thing except using the video from this post: http://codepen.io/fta/pen/JoGybG




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: