{"id":371,"date":"2009-08-08T18:58:27","date_gmt":"2009-08-09T01:58:27","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1951"},"modified":"2009-08-08T18:58:27","modified_gmt":"2009-08-09T01:58:27","slug":"interesting-texture","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=371","title":{"rendered":"Interesting Texture"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar canvas:BitmapData = new BitmapData(1000,1000,false, 0x000000);\r\naddChild(new Bitmap(canvas));\r\nscaleX = scaleY = .5;\r\n\r\nvar w:int = canvas.width;\r\nvar w10:int = w * 60;\r\nvar size:int = canvas.width * canvas.height;\r\nfor (var i:int = 0; i&lt;size; i++){\r\n\tvar xp:int = i % w;\r\n\t \r\n\tvar yp:int = int(i \/ w);\r\n\tvar c1:int = (255\/8) * (Math.cos(xp* Math.PI\/180 * 2) + Math.sin(yp*yp\/w10));\r\n\tif (c1 &lt; 0) c1 = 256 - c1;\r\n\tc1 = (c1 &lt;&lt; 1 | c1) ;\r\n\tcanvas.setPixel(xp, yp, c1 &lt;&lt;16 | c1 &lt;&lt;8 | c1 );\r\n}\r\nvar m:Matrix = new Matrix();\r\nm.scale(1,-1);\r\nm.translate(0,canvas.height);\r\nvar clone:BitmapData = canvas.clone();\r\ncanvas.draw(clone, m, null, BlendMode.SUBTRACT);\r\nclone.draw(canvas);\r\nclone.applyFilter(clone, clone.rect, new Point(0,0), new BlurFilter(10,10,1));\r\ncanvas.draw(clone, null, null, BlendMode.ADD);\r\n<\/pre>\n<p>Having one of those days where everything I code doesn&#8217;t look right to me&#8230; took a little break from other work and created this very unoptimized abstract texture&#8230; no animation so here is a bitmap:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/abstex.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var canvas:BitmapData = new BitmapData(1000,1000,false, 0x000000); addChild(new Bitmap(canvas)); scaleX = scaleY = .5; var w:int = canvas.width; var w10:int = w * 60; var size:int = canvas.width * canvas.height; for (var i:int = 0; i&lt;size; i++){ var xp:int = i % w; var yp:int = int(i \/ w); var c1:int = (255\/8) * (Math.cos(xp* Math.PI\/180 [&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":[99,14,4],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-bitmapdata","category-pixel-manipulation","category-setpixel","tag-actionsnippet","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/371","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=371"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}