{"id":817,"date":"2012-03-26T22:04:14","date_gmt":"2012-03-26T19:04:14","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=817"},"modified":"2014-06-07T16:02:41","modified_gmt":"2014-06-07T13:02:41","slug":"monotone-chain-convex-hull-algorithm-unity","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/03\/26\/monotone-chain-convex-hull-algorithm-unity\/","title":{"rendered":"Monotone Chain Convex Hull Algorithm"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"818\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/03\/26\/monotone-chain-convex-hull-algorithm-unity\/convex_hull_unity\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?fit=680%2C476&amp;ssl=1\" data-orig-size=\"680,476\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"convex_hull_unity\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?fit=680%2C476&amp;ssl=1\" class=\"alignnone size-full wp-image-818\" title=\"convex_hull_unity\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?resize=680%2C476\" alt=\"\" width=\"680\" height=\"476\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?resize=300%2C210&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>Finally got atleast some 2D <a title=\"http:\/\/en.wikipedia.org\/wiki\/Convex_hull_algorithms\" href=\"http:\/\/en.wikipedia.org\/wiki\/Convex_hull_algorithms\" target=\"_blank\">convex hull algorithm<\/a> working.. this one is converted from those Java &amp; Python versions.<br \/>\nConverted the java version first and it kept giving strange results, then took the sub() from python and it worked rightaway..<\/p>\n<p>Now can try this for the\u00a0<a title=\"http:\/\/unitycoder.com\/blog\/2012\/01\/27\/simple-shadow-casting-algorithm-unity\/\" href=\"http:\/\/unitycoder.com\/blog\/2012\/01\/27\/simple-shadow-casting-algorithm-unity\/\" target=\"_blank\"> shadow casting test<\/a>, should be possible to cast somekind of shadows to a flat surface(?)<\/p>\n<p>It was quite difficult to sort an Vector3 array with javascript in Unity..<br \/>\nfounded some help <a title=\"http:\/\/answers.unity3d.com\/questions\/22261\/sorting-builtin-arrays.html\" href=\"http:\/\/answers.unity3d.com\/questions\/22261\/sorting-builtin-arrays.html\" target=\"_blank\">from unity answers<\/a>, but most of those examples didnt seem to work without modifications..<\/p>\n<p><strong>Webplayer:<\/strong><br \/>\nnothing much to see on it..<\/p>\n<p><strong>Download source:<\/strong><br \/>\n<a title=\"Download (with UnityCoder toolbar)\" href=\"http:\/\/unitycoder.com\/download\/index2.php?link=250&amp;uid=un1t3c0d5r\" target=\"_blank\">MonotoneChainConvexHull.unitypackage<\/a> (javascript)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally got atleast some 2D convex hull algorithm working.. this one is converted from those Java &amp; Python versions. Converted the java version first and it kept giving strange results, then took the sub() from python and it worked rightaway.. Now can try this for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":818,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,3],"tags":[93,215],"class_list":["post-817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-algorithm","tag-convex-hull"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/03\/convex_hull_unity.jpg?fit=680%2C476&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-db","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=817"}],"version-history":[{"count":10,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/817\/revisions"}],"predecessor-version":[{"id":2986,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/817\/revisions\/2986"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/818"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}