{"id":116,"date":"2018-07-24T11:04:31","date_gmt":"2018-07-24T11:04:31","guid":{"rendered":"https:\/\/blogs.scummvm.org\/drenn1\/?p=116"},"modified":"2022-05-24T11:05:38","modified_gmt":"2022-05-24T11:05:38","slug":"gsoc-week-9-space-and-glitchy-planet-rendering","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/drenn1\/2018\/07\/24\/gsoc-week-9-space-and-glitchy-planet-rendering\/","title":{"rendered":"GSoC Week 9: Space, and glitchy planet rendering"},"content":{"rendered":"<p>This past week has been spent on space; trying to make heads or tails of the game\u2019s \u201cpseudo-3d\u201d engine. And, while it hasn\u2019t been entirely unsuccessful, progress on this front has been relatively slow.<\/p>\n<p>I started by getting the background starfield working. It involved some trigonometric functions and matrix multiplication. Nothing too insane, once I figured out what I was looking at. To complicate matters, the game has at least 3 fixed-point decimal formats, including a format specifically for numbers between -1 and 1, in addition to using the processor\u2019s floating-point hardware on occasion.<\/p>\n<div>\n<figure class=\"image\"><img decoding=\"async\" src=\"..\/images\/gsoc-week-9-space.gif\" alt=\"\" \/><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/blogs.scummvm.org\/drenn1\/wp-content\/uploads\/sites\/62\/2022\/05\/gsoc-week-9-space.gif\" \/><figcaption><\/figcaption><\/figure>\n<\/div>\n<p>Encouraged by this early progress, the next step was to make more elements of the game\u2019s intro visible, starting with the red planet the Enterprise flies past. However, when I finally reached the function which draws space objects to the screen, the function graph showed me this would be no picnic.<\/p>\n<div>\n<figure class=\"image\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/blogs.scummvm.org\/drenn1\/wp-content\/uploads\/sites\/62\/2022\/05\/gsoc-week-9-graph.png\" \/><figcaption>Each box is a block of code, some too small to see.<\/figcaption><\/figure>\n<\/div>\n<p>Despite my best efforts, I was unable to quite get this working properly. I discovered today that I didn\u2019t even have an accurate view of the function, because part of the code is overwritten from elsewhere before it gets called! Perhaps because of this incompleteness, I was only able to get a sliver of the image to appear in a glitchy way.<\/p>\n<div>\n<figure class=\"image\"><img decoding=\"async\" src=\"..\/images\/gsoc-week-9-planet.png\" alt=\"\" \/><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/blogs.scummvm.org\/drenn1\/wp-content\/uploads\/sites\/62\/2022\/05\/gsoc-week-9-planet.png\" \/><figcaption><\/figcaption><\/figure>\n<\/div>\n<p>I\u2019ll figure this out, eventually. But I alotted myself a week to work on this before moving on to other things, so I\u2019ll come back to this later. It\u2019s time to start focusing on code cleanup so this can be merged into scummvm, as well as finishing up the away missions. Then, I\u2019ll come back to finish space combat and everything between missions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This past week has been spent on space; trying to make heads or tails of the game\u2019s \u201cpseudo-3d\u201d engine. And, while it hasn\u2019t been entirely unsuccessful, progress on this front has been relatively slow. I started by getting the background starfield working. It involved some trigonometric functions and matrix multiplication. Nothing too insane, once I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/posts\/116\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/drenn1\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}