{"id":401,"date":"2021-12-25T06:20:00","date_gmt":"2021-12-25T06:20:00","guid":{"rendered":"https:\/\/blog.kekling.com\/?p=401"},"modified":"2022-02-19T07:02:13","modified_gmt":"2022-02-19T07:02:13","slug":"projection-mapping","status":"publish","type":"post","link":"https:\/\/blog.kekling.com\/?p=401","title":{"rendered":"Projection Mapping"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/001.mp4\"><\/video><\/figure>\n\n\n\n<p>Many people have asked how to do some q&amp;d projection mapping, so here&#8217;s the rundown:<\/p>\n\n\n\n<ol><li>Put the projector up, screw it in so it doesn&#8217;t move.<\/li><li>Plug in a computer and open a drawing program (I used <a href=\"https:\/\/www.gimp.org\/\">Gimp<\/a>, you can duplicate the working working image and output it to the projector to see the full resolution image as you edit it) and draw over the features of the castle to figure out where things need to be in the videos (position of the clock, the tower, etc). This honestly feels surreal, it looks like you&#8217;re painting the castle as you draw over it\u2026 I also marked parts of the image I didn&#8217;t want to project anything to as the projector covers a bit of the walls beside the table. That&#8217;s why there are weird diagonal black bars on each side of the image.<\/li><li>Load your sketch and the video in <a href=\"https:\/\/natrongithub.github.io\/\" data-type=\"URL\" data-id=\"https:\/\/natrongithub.github.io\/\">Natron<\/a> and start playing the the corner pin transform until you get something close.  The Merge block allows you to put the sketch from the previous step at 50% opacity over the video to align the features, but you can make the sketch transparent when you render the final video. The transform is different for each video as the position of the camera relative to the castle is different depending on where the recording was made. The transform also takes into consideration the relative position of the projector and the Lego castle, which would be different if you did it.<\/li><li>Export the video<\/li><li>Play it back. My projector plays videos straight from a usb drive, so that was easy enough\u2026<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-gallery columns-3 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY.png\"><img loading=\"lazy\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-1024x576.png\" alt=\"\" data-id=\"405\" data-full-url=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY.png\" data-link=\"https:\/\/blog.kekling.com\/?attachment_id=405\" class=\"wp-image-405\" srcset=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-1024x576.png 1024w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-300x169.png 300w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-768x432.png 768w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-520x292.png 520w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY-940x529.png 940w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/rFtsbeY.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Sketch used to align features<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC.jpg\"><img loading=\"lazy\" width=\"993\" height=\"563\" src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC.jpg\" alt=\"\" data-id=\"404\" data-full-url=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC.jpg\" data-link=\"https:\/\/blog.kekling.com\/?attachment_id=404\" class=\"wp-image-404\" srcset=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC.jpg 993w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC-300x170.jpg 300w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/cV4bLFC-768x435.jpg 768w\" sizes=\"(max-width: 993px) 100vw, 993px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Natron Graph<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-1024x576.jpg\" alt=\"\" data-id=\"403\" data-full-url=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2.jpg\" data-link=\"https:\/\/blog.kekling.com\/?attachment_id=403\" class=\"wp-image-403\" srcset=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-1024x576.jpg 1024w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-300x169.jpg 300w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-768x432.jpg 768w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-520x292.jpg 520w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2-940x529.jpg 940w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2022\/02\/WKrrwf2.jpg 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Example distorted frame<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>This is a VERY poor man&#8217;s projection mapping, but the illusion is &#8220;good enough&#8221; for suspension of disbelief.  Normally you&#8217;d want to calibrate the projector, get the camera projection parameters from the original video and compute the real transformation, but that&#8217;s too much work for a Lego set\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many people have asked how to do some q&amp;d projection mapping, so here&#8217;s the rundown: Put the projector up, screw it in so it doesn&#8217;t move.&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[41],"_links":{"self":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/401"}],"collection":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":2,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"predecessor-version":[{"id":417,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions\/417"}],"wp:attachment":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}