Projection Mapping Toolkit
I’ve been working on a Projection Mapping tool to get a better understanding of the technique behind Projection Mapping. The main goal of the tool is to get as quickly as possible a basic projection scene up and running.
The tool has the following functionality:
- Importing custom content (images and videos)
- Perspective warping of content
- Pencil Mask to hide parts of content
- Fullscreen projection view
Projection Mapping Technique
The most important part about projection mapping is warping content (image, video) to a real-life object. In the tool images can be warped into perspective. I did this by calculating a perspective grid and then generating a 3D-plane of the grid with all the Texture-Coordinates (UV’s) in perspective. The content is just a material that’s on the plane.
Generating the grid is done by subdividing a quad multiple times. I made an animation to demonstrate how the subdivision formula works (video 1.).
The formula is used as a recursive algorithm. A quad is subdivided into four new quads. Those quads are subdivided again and we repeat that step for a few iterations. I made a comparison to show the impact on the quality of the image as the number of iterations gets bigger (image 2.). As you can see in the picture with 0 subdivisions (most left picture), there’s a lot of deformation going on. I found out that four subdivisions work well in most situations.
(video 1.) Animation of a quad subdivision
(video 2.) Final Projection Mapping Scene