{"id":122,"date":"2008-12-13T00:00:14","date_gmt":"2008-12-13T07:00:14","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=349"},"modified":"2008-12-13T00:00:14","modified_gmt":"2008-12-13T07:00:14","slug":"hidden-sierpinski","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=122","title":{"rendered":"Hidden Sierpi\u0144ski"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar canvas:BitmapData=new BitmapData(255,255,false,0x000000);\r\naddChild(new Bitmap(canvas, &quot;auto&quot;, true));\r\n\r\nscaleX = scaleY = 1.5;\r\n\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\tfor (var i:int  = 0; i&lt;canvas.width * canvas.height; i++) {\r\n\t\tvar ox:int= i % canvas.width;\r\n\t\tvar oy:int= i \/ canvas.width;\r\n\t\tvar col =  (ox | oy) * mouseX % 255;\r\n\t\tcanvas.setPixel(ox, oy, col &lt;&lt; 16 | col &lt;&lt; 8 | col);\r\n\t}\r\n}\r\n<\/pre>\n<p>Sometimes when I&#8217;m writing a program that does some pixel pushing I&#8217;ll save the file and then start arbitrarily adding bitwise operations to it&#8230;. just to see what happens. Sierpinski-esque stuff occurs <a href=\"http:\/\/shapevent.com\/sketchbook\/2008\/09\/12\/sierpinski-accident\/\" target='_blank'>often.<\/a> This will work in your timeline &#8211; move your mouse left and right to generate images like these:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.actionsnippet.com\/imgs\/tri_tex_one.jpg\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.actionsnippet.com\/imgs\/tri_tex_two.jpg\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.actionsnippet.com\/imgs\/tri_tex_three.jpg\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.actionsnippet.com\/imgs\/tri_tex_four.jpg\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.actionsnippet.com\/imgs\/tri_tex_five.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var canvas:BitmapData=new BitmapData(255,255,false,0x000000); addChild(new Bitmap(canvas, &quot;auto&quot;, true)); scaleX = scaleY = 1.5; addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { for (var i:int = 0; i&lt;canvas.width * canvas.height; i++) { var ox:int= i % canvas.width; var oy:int= i \/ canvas.width; var col = (ox | oy) * mouseX % 255; canvas.setPixel(ox, oy, col &lt;&lt; 16 | col &lt;&lt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,25,26],"tags":[3,4,95],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-bitmapdata","category-pixel-manipulation","category-setpixel","tag-actionscript","tag-flash","tag-sierpinski"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=122"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}