{"id":893,"date":"2009-10-09T23:53:35","date_gmt":"2009-10-09T12:53:35","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=893"},"modified":"2009-10-09T23:53:48","modified_gmt":"2009-10-09T12:53:48","slug":"clipping","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2009\/10\/09\/clipping\/","title":{"rendered":"Clipping"},"content":{"rendered":"

\"Voronoi2\"<\/a>This screenshot is basically invisible, in this thumbnail. \u00a0Today’s work was clipping Voronoi regions against other regions. \u00a0In computer graphics, “clipping” generally means not drawing something; \u00a0usually this is in reference to 3D objects. \u00a0For example, you might “clip” a 3D model against the viewing area, and then not bother drawing any parts of the 3D model which aren’t at least partly inside the viewing area.<\/p>\n

In this case, I’m clipping the new region boundaries against the world boundaries. \u00a0You wouldn’t imagine that this sort of thing would be difficult, but.. \u00a0it’s surprisingly tricky! \u00a0(I still seem to have a minor bug in it, which is causing things which extend past the southwest corner of the world borders not to be clipped as they should… so in this screenshot, I’m cleverly looking northeast, thus hiding that bug)<\/p>\n

Of course, the reason that this clipping is tricky is that I’m clipping “arbitrary polygon vs. arbitrary other polygon”, instead of the more usual “box vs. box” or “box vs. view frustum” tests that you’d do during rendering, to determine whether it was worth rendering a 3D object at all.<\/p>\n

Anyhow. \u00a0Math\/geometry buffs might be interested to know that I’m using the Weiler-Atherton polygon clipping algorithm<\/a>, which is probably the best one out there for clipping arbitrary polygons against each other.<\/p>\n

I’ll also note that this is the last maths\/tech-heavy post for a while. \u00a0Now that this is done (apart from that one remaining bug, which I’ll probably ignore), I’m going to be moving back over onto game mechanics again.<\/p>\n","protected":false},"excerpt":{"rendered":"

This screenshot is basically invisible, in this thumbnail. \u00a0Today’s work was clipping Voronoi regions against other regions. \u00a0In computer graphics, “clipping” generally means not drawing something; \u00a0usually this is in reference to 3D objects. \u00a0For example, you might “clip” a 3D model against the viewing area, and then not bother drawing any parts of the…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[24,25],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/so9WK-clipping","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/893"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}