{"id":51,"date":"2015-04-13T02:35:58","date_gmt":"2015-04-13T02:35:58","guid":{"rendered":"http:\/\/metareal.net\/blog\/?p=51"},"modified":"2015-04-13T02:35:58","modified_gmt":"2015-04-13T02:35:58","slug":"editing-bitmaps-and-mesh","status":"publish","type":"post","link":"http:\/\/metareal.net\/blog\/?p=51","title":{"rendered":"Editing, Bitmaps, and Mesh"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/metareal.net\/blog\/wp-content\/uploads\/2015\/04\/2015-04-12b.gif\"\/><\/p>\n<p>Added a tremendously useful parameter type to the editor: 1-bit-deep bitmap type. The editor is clunky, by traditional standards, but as ever, fine for me.<\/p>\n<p>One use for a bitmap parameter on an object is to procedurally generate its geometry. Allows a wide variety of expression without importing 3d assets. Since part of the &#8220;look&#8221; of the product will be &#8220;code, code, code&#8221;, this works well. The relatedness of the forms conveys the fact nicely.<\/p>\n<p>Generating mesh from bitmap was fun. I used a greedy algorithm to find rectangles from top left to bottom right, knocking out bits once found. Tracing the extrusion edges was trickier. It works by:<\/p>\n<ul>\n<li>Building a list of every unit segment which is an edge (0-1 boundaries)<\/li>\n<li>Take one, and link to the next &#038; the next, until the star point is re-found<\/li>\n<li>Make the sides longer than unit segments: any three matching X&#8217;s or Y&#8217;s in a row, remove the middle vertex. Repeat.<\/li>\n<li>For each loop, determine if it is clockwise or counterclockwise (4 more lefts than right, or four more rights than left<\/li>\n<li>Determine if it&#8217;s contains bits or spaces &#8212; find the leftmost lowest corner, and see if it surrounds a bit or a space<\/li>\n<li>If necessary, reverse the loop (bits clockwise, spaces counterclockwise) so the faces face outward from the final geometry.\n<\/ul>\n<p>Also, beginnings of mapping these objects to Volume Collision Objects. The world begins to operate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Added a tremendously useful parameter type to the editor: 1-bit-deep bitmap type. The editor is clunky, by traditional standards, but as ever, fine for me. One use for a bitmap parameter on an object is to procedurally generate its geometry. Allows a wide variety of expression without importing 3d assets. Since part of the &#8220;look&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-3"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":1,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":53,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions\/53"}],"wp:attachment":[{"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/metareal.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}