{"id":4741,"date":"2017-09-13T16:21:16","date_gmt":"2017-09-13T20:21:16","guid":{"rendered":"https:\/\/blogs.mathworks.com\/community\/?p=4741"},"modified":"2017-09-13T16:47:05","modified_gmt":"2017-09-13T20:47:05","slug":"a-galloping-logo-zoetrope","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2017\/09\/13\/a-galloping-logo-zoetrope\/","title":{"rendered":"A Galloping Logo Zoetrope"},"content":{"rendered":"<p>What is a zoetrope? A <a href=\"https:\/\/en.wikipedia.org\/wiki\/Zoetrope\">zoetrope<\/a> is a simple kind of animation, first popularized in the 1800s. Take twelve images of a running horse, for example. Paste them on the inside of a cylinder and spin the cylinder. The images catch your eye as they go by, and you are left with the impression of seeing a running horse.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"144\" height=\"93\" class=\"alignnone size-full wp-image-4744\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope_horse.gif\" alt=\"\" \/><\/p>\n<p>You can bring this old idea into the 21st century by using 3D prints instead of photographs of a race horse. With this in mind, it occurred to me that it would be fun to build a zoetrope-style animation of the MathWorks logo (affectionately known around here as the <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2014\/10\/13\/mathworks-logo-part-one-why-is-it-l-shaped\/?s_tid=srchtitle\">L-shaped membrane<\/a>). Part of my inspiration is the fact that <a href=\"https:\/\/blogs.mathworks.com\/cleve\/\">Cleve Moler<\/a> has made many interesting and entertaining visualizations of the membrane over the years. If you want to see one, install his <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59085-cleve-laboratory\">Cleve&#8217;s Laboratory app<\/a> and run the first demo, logo_wave (<a href=\"https:\/\/www.mathworks.com\/company\/newsletters\/articles\/introducing-cleves-laboratory.html\">more info here<\/a>). Here&#8217;s a screenshot of it in action.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"418\" height=\"417\" class=\"alignnone size-full wp-image-4751\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/logo_wave.png\" alt=\"\" \/><\/p>\n<p>But now we want to build this animation as a zoetrope. How will that work? Here is the basic idea. Build a 15 step looping animation of an L-shaped membrane. Arrange these shapes in a circle and spin them on a turntable. The last step is to add a strobe light so the frames appear to line up properly. It&#8217;s easy to do the first part in MATLAB. I remember learning from graphics guru Mike Garrity how to use the HGTRANSFORM command to move 3D objects around.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"579\" height=\"596\" class=\"alignnone size-full wp-image-4753\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope_code.png\" alt=\"\" \/><\/p>\n<p>This code generates an image like this.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"411\" height=\"255\" class=\"alignnone size-full wp-image-4754\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope00.png\" alt=\"\" \/><\/p>\n<p>We&#8217;ll\u00a0modify the shape slightly to make it solid, rather than infinitely thin. Now we just have to\u00a0set it spinning to get the illusion of animation.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"482\" height=\"433\" class=\"alignnone size-full wp-image-4745\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope01.gif\" alt=\"\" \/><\/p>\n<p>What do you think? Is the magic working for you? No? This is why we have to add the strobe light. If you catch the spinning platter at precisely the right moment, you now see this.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"482\" height=\"433\" class=\"alignnone size-full wp-image-4746\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope02.gif\" alt=\"\" \/><\/p>\n<p>This is the effect we&#8217;re after. So we now have a design. But how are we going to make the prints? I already knew that Paul Kassebaum had written code to turn MATLAB objects into the STL files that a 3d printer needs (see <a title=\"https:\/\/blogs.mathworks.com\/community\/2013\/06\/20\/paul-prints-the-l-shaped-membrane\/ (link no longer works)\">Paul Prints the L-Shaped Membrane<\/a>). Once we had the STL files we needed, we used a <a href=\"https:\/\/formlabs.com\/3d-printers\/form-2\/\">Form 2 3D printer<\/a> from <a href=\"https:\/\/formlabs.com\/\">Formlabs<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"458\" height=\"361\" class=\"alignnone size-full wp-image-4755\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/3d_print.jpg\" alt=\"\" \/><\/p>\n<p>Here&#8217;s what the prints looked like after drying out.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"600\" height=\"421\" class=\"alignnone size-full wp-image-4747\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/gray_membranes.jpg\" alt=\"\" \/><\/p>\n<p>Now for the tricky part: painting the membranes and mounting them to a turntable. In this age of digital music, there are lots of old record players sitting around. We located\u00a0a\u00a0suitable turntable and swapped out the tone arm for a goose neck strobe light. Throw in a light switch and a potentiometer to control the strobe speed, and we&#8217;re nearly done. Here is the final result.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"600\" height=\"428\" class=\"alignnone size-full wp-image-4748\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope_final.png\" alt=\"\" \/><\/p>\n<p>Incidentally, the record on which the prints are mounted is &#8220;Meet the Beatles&#8221; from 1964, in honor of the <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2014\/10\/22\/mathworks-logo-part-two-finite-differences\/\">membrane&#8217;s birth year<\/a>.<\/p>\n<p>So what does it look like when it runs? It looks awesome! But it&#8217;s hard to make a good video of something being illuminated by a strobe. The animation below simulates the effect with stop-motion image capture. <em>Et voil\u00e0!\u00a0<\/em>A three-dimensional MATLAB movie.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"480\" height=\"270\" class=\"alignnone size-full wp-image-4749\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/stop_frame.gif\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/zoetrope_horse.gif\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>What is a zoetrope? A zoetrope is a simple kind of animation, first popularized in the 1800s. Take twelve images of a running horse, for example. Paste them on the inside of a cylinder and spin the&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2017\/09\/13\/a-galloping-logo-zoetrope\/\">read more >><\/a><\/p>\n","protected":false},"author":69,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/4741"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=4741"}],"version-history":[{"count":14,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/4741\/revisions"}],"predecessor-version":[{"id":4765,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/4741\/revisions\/4765"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=4741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=4741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=4741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}