{"id":470,"date":"2012-01-19T20:16:51","date_gmt":"2012-01-19T17:16:51","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=470"},"modified":"2021-01-08T19:06:05","modified_gmt":"2021-01-08T17:06:05","slug":"bresenhams-line-algorithm-unity-javascript","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/01\/19\/bresenhams-line-algorithm-unity-javascript\/","title":{"rendered":"Bresenham&#8217;s line algorithm (Unity javascript)"},"content":{"rendered":"<p><a href=\"http:\/\/unitycoder.com\/upload\/demos\/Bresenhamline\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"471\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/01\/19\/bresenhams-line-algorithm-unity-javascript\/500px-bresenham-svg\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?fit=500%2C269&amp;ssl=1\" data-orig-size=\"500,269\" 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=\"500px-Bresenham.svg\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?fit=500%2C269&amp;ssl=1\" class=\"alignnone size-full wp-image-471\" title=\"500px-Bresenham.svg\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?resize=500%2C269\" alt=\"\" width=\"500\" height=\"269\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?w=500&amp;ssl=1 500w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?resize=300%2C161&amp;ssl=1 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><br \/><em>* image from wikipedia, public domain<\/em><\/p>\n<p>Converted this function to Unity javascript: <a href=\"http:\/\/en.wikipedia.org\/wiki\/Bresenham%27s_line_algorithm\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/en.wikipedia.org\/wiki\/Bresenham%27s_line_algorithm<\/a><\/p>\n<p><strong>Notes:<\/strong><br \/>It works..<\/p>\n<p><strong>Webplayer:<\/strong><br \/><a href=\"http:\/\/unitycoder.com\/upload\/demos\/Bresenhamline\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/unitycoder.com\/upload\/demos\/Bresenhamline\/<\/a><\/p>\n<p><strong>Download webplayer source:<\/strong><br \/><a title=\"Download Source\" href=\"http:\/\/unitycoder.com\/download\/index2.php?link=86&amp;uid=un1t3c0d5r\" target=\"_blank\" rel=\"noopener noreferrer\">Bresenham.unitypackage<\/a><\/p>\n\n\n<p><strong>old unityscript source<\/strong><br><a href=\"https:\/\/gist.github.com\/unitycoder\/90f0f1896e38a13d98e3d0c84ea45789\">https:\/\/gist.github.com\/unitycoder\/90f0f1896e38a13d98e3d0c84ea45789<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>* image from wikipedia, public domain Converted this function to Unity javascript: http:\/\/en.wikipedia.org\/wiki\/Bresenham%27s_line_algorithm Notes:It works.. Webplayer:http:\/\/unitycoder.com\/upload\/demos\/Bresenhamline\/ Download webplayer source:Bresenham.unitypackage old unityscript sourcehttps:\/\/gist.github.com\/unitycoder\/90f0f1896e38a13d98e3d0c84ea45789<\/p>\n","protected":false},"author":1,"featured_media":471,"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,123,76,122],"class_list":["post-470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-algorithm","tag-drawing","tag-line","tag-lines"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/500px-Bresenham.svg_.png?fit=500%2C269&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-7A","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/470","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=470"}],"version-history":[{"count":6,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":5308,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/470\/revisions\/5308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/471"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}