{"id":2117,"date":"2015-02-19T21:49:00","date_gmt":"2015-02-19T21:49:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=2117"},"modified":"2015-02-13T14:54:55","modified_gmt":"2015-02-13T14:54:55","slug":"bug-fixing","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=2117","title":{"rendered":"Bug-fixing"},"content":{"rendered":"<p align=\"justify\">Today it was bug-fixing time\u2026<\/p>\n<p align=\"justify\">First bug was an old one that was annoying me, even if it was simple to solve: the screen would turn purple on transition between areas\u2026<\/p>\n<p align=\"justify\">The second bug was the normals on the objects\u2026 For imported objects, I\u2019m using the 3ds format (because it was simple and I already had a function to load them), but the 3ds format doesn\u2019t store normals, so they have to be computed after importing\u2026<\/p>\n<p align=\"justify\">What I was doing so far was building smooth normals: assume all points that share a (X,Y,Z) are the exact same point and as such they should share the normal and should be smooth along the surface\u2026 <\/p>\n<p align=\"justify\">This would lead to weird results in stuff that should be more \u201cstraight\u201d in nature, by smoothing stuff that should be flat:<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/02\/screen450.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen450\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen450\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/02\/screen450_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>You can see that on the console and especially in the \u201cpower generators\u201d\u2026 <\/p>\n<p>Now I\u2019ve added a tolerance factor, which basically makes all adjacent triangles that differ by less than the tolerance angle to be treated as continuous\u2026<\/p>\n<p>Below you can see the effect with the new normal generation:<\/p>\n<p><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/02\/screen451.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen451\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen451\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/02\/screen451_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>Much more accurate and in line with what I actually want from the system in visual terms\u2026<\/p>\n<p><em>Now listening to \u201cRed Shift\u201d by \u201cAsgaroth\u201d<\/em><\/p>\n<p><em>Link of the Day: The game doesn\u2019t seem much like my thing, but the graphical style is amazing! <\/em><\/p>\n<div id=\"scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:5677be46-6730-4d91-8524-cc535fa332c1\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<div><object width=\"448\" height=\"252\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/9dhfsg1waxk?hl=en&amp;hd=1\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/9dhfsg1waxk?hl=en&amp;hd=1\" type=\"application\/x-shockwave-flash\" width=\"448\" height=\"252\"><\/embed><\/object><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today it was bug-fixing time\u2026 First bug was an old one that was annoying me, even if it was simple to solve: the screen would turn purple on transition between areas\u2026 The second bug was the normals on the objects\u2026 For imported objects, I\u2019m using the 3ds format (because it was simple and I already [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,147,8],"tags":[184,242],"class_list":["post-2117","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-bugs","tag-polish"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2117"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2117\/revisions"}],"predecessor-version":[{"id":2118,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2117\/revisions\/2118"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}