{"id":24,"date":"2023-05-04T16:01:36","date_gmt":"2023-05-04T16:01:36","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/ruzickas\/?p=24"},"modified":"2023-05-04T16:02:42","modified_gmt":"2023-05-04T16:02:42","slug":"blog-post-3","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/ruzickas\/2023\/05\/04\/blog-post-3\/","title":{"rendered":"Blog Post #3"},"content":{"rendered":"\n<p>My thoughts on the journey so far, the pains of 3D in the web, and if my project is on-track to succeed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"328\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6771\/files\/2023\/05\/tour-man-redcpu-1024x328.jpg\" alt=\"\" class=\"wp-image-25\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6771\/files\/2023\/05\/tour-man-redcpu-1024x328.jpg 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6771\/files\/2023\/05\/tour-man-redcpu-300x96.jpg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6771\/files\/2023\/05\/tour-man-redcpu-768x246.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6771\/files\/2023\/05\/tour-man-redcpu.jpg 1250w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>How is the journey so far?<\/strong><\/p>\n\n\n\n<p>So the above picture kind of summarizes my journey so far &#8211; going from frustration to contentment. I started off this second sprint with a fully completed 3D room in Blender, so my first task was to test if I could translate that to the web. Well as soon as I got my Three.js code working, I ran the code and watched as the errors fill my console log. I had completely forgotten that in order to use assets from Blender in the web almost everything needs to be &#8220;**baked&#8221; first!<\/p>\n\n\n\n<p class=\"has-small-font-size\">**Baking, in general, is&nbsp;<strong>the act of pre-computing something in order to speed up some other process later down the line<\/strong>. (From the Blender docs)<\/p>\n\n\n\n<p>I had been throwing all sorts of free assets into that room without a care in the world. With each pre-made asset comes multiple texture maps (between 3 &#8211; 6) and potentially millions of new polygons the scene now has to render! So, I had to go back to the drawing board, scrapping everything I had done so far and restarting with a simple room &#8211; just some walls and a table. I threw that into the demo file I had created and it worked! Now came the task of implementing that demo into our teams repo, but there was only one problem&#8230;it was in React. Now I thought this would be a relatively trivial task, especially with the help of ChatGPT by my side. The problem is that I needed to use React Three Fiber, which launched in 2019, so many of it&#8217;s updates and improvements happened after the cutoff date for the GPT tools. This meant I had to rewrite the entire code from the ground up as components and rethink some of the tricks I had used in Three.js. <\/p>\n\n\n\n<p>For example, there is a controller for the camera called &#8220;Orbit Controls&#8221; that allows the user to pan and rotate around the screen with their mouse. In Three.js, I could set a hard-coded camera position to look at a table on-click by just overriding the current camera. In R3F, the Orbit Controls are consistently being updated, so any camera changes will be overridden. To fix this, every time a click event is initiated I have it check if something relevant has been clicked, and if so, it will temporarily disable the Orbit Controls, then set the camera. This was a relatively simple fix, but it was one of many.<\/p>\n\n\n\n<p><strong>Do you feel your project is on-track to succeed? If not, what do you plan to do to help the team get back on track?<\/strong><\/p>\n\n\n\n<p>All that being said, it probably seems like the project is doomed for failure. In fact, I am more optimistic than ever that this project is on the right track. The hardest part was getting everything set up in the repo and working on the web. Now that&#8217;s out of the way the rest is easy(ish)! I have animations, click-events, camera controls, overlays, and pretty much everything I thought we would need for a fully functioning escape room working. All that&#8217;s left now is filling out the room with objects, adding the necessary interactions, and refining as much as we have time for. I&#8217;m confident that my team will be able to complete one, solid room. If we can complete 2 or even 3, I would be overjoyed. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>My thoughts on the journey so far, the pains of 3D in the web, and if my project is on-track to succeed. How is the journey so far? So the above picture kind of summarizes my journey so far &#8211; going from frustration to contentment. I started off this second sprint with a fully completed [&hellip;]<\/p>\n","protected":false},"author":13452,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/users\/13452"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":3,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/posts\/24\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/ruzickas\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}