<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: waldowred5</title>
    <description>The latest articles on DEV Community by waldowred5 (@waldowred5).</description>
    <link>https://dev.to/waldowred5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F612964%2Fe973e50b-6ca9-4dff-900b-2ea674c60724.jpeg</url>
      <title>DEV Community: waldowred5</title>
      <link>https://dev.to/waldowred5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/waldowred5"/>
    <language>en</language>
    <item>
      <title>How I Kickstarted My Dev Career by Doubling Down on My Education Debt</title>
      <dc:creator>waldowred5</dc:creator>
      <pubDate>Sun, 25 Apr 2021 13:46:29 +0000</pubDate>
      <link>https://dev.to/waldowred5/how-i-kickstarted-my-dev-career-by-doubling-down-on-my-education-debt-1ik4</link>
      <guid>https://dev.to/waldowred5/how-i-kickstarted-my-dev-career-by-doubling-down-on-my-education-debt-1ik4</guid>
      <description>&lt;p&gt;For anyone looking to become a professional developer, there are only three ways to go from zero to coding hero:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Traditional Route - Study a bachelor of computer science at a university or college&lt;/li&gt;
&lt;li&gt;Modern Route - Become a self-taught programmer&lt;/li&gt;
&lt;li&gt;Industry Route - Enroll in a coding boot camp&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of these routes are viable paths to your first paid developer role, they are just not all equal. While each has benefits and drawbacks, there is one that is more likely to launch your dev career to the stars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;But first, a short story...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I left high school, I was convinced I wanted to be a doctor. If I could go back and tell my younger self I would eventually be hired to help build the world's first blockchain-based superannuation* platform, I doubt he would believe me. &lt;/p&gt;

&lt;p&gt;&lt;sup&gt;For all the non-Australian readers, &lt;strong&gt;superannuation&lt;/strong&gt; is the Australian system for compulsory contributions to a retirement fund, similar to a 401k in the US.&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;I went to university, studying a bachelor of medical science, eager to pave my way to 'Dr.' status. To my surprise and dismay, I hated it. With no passion or clear direction, I ambled my way through my degree, putting in an embarrassingly small amount of effort. &lt;/p&gt;

&lt;p&gt;What seemed like the longest three years of my life, the end of my time at university was looming around the corner. I joined a charity sales call centre to get some cash and work experience. I know, one of 'those' people. &lt;/p&gt;

&lt;p&gt;It was at this point I first discovered the tech industry, being recruited into the sales team for a global software company. I was flown around the world, the commission was great and I was loving life, but four years and a few companies later, the rose-coloured glasses had begun to crack. It was time to choose a career that suited me, instead of letting a career choose me.&lt;/p&gt;

&lt;p&gt;I was seven years past the optimal point to start a new career, and another bachelor's degree was one of the least appealing options I could imagine. Was I really about to start all over again?&lt;/p&gt;

&lt;p&gt;You have probably guessed which of the three routes I think is the best, but if not, it is the industry route, a &lt;strong&gt;coding boot camp&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;While boot camps can have many different types of successful students, it is really best suited for those looking to  switch careers, balancing the need to finish ASAP with the need to gain enough proficiency to land a job.&lt;/p&gt;

&lt;p&gt;With that disclaimer out of the way, here are the top reasons why you should seriously consider enrolling in a coding boot camp if you want to be a professional developer:&lt;/p&gt;

&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;p&gt;The most obvious advantage is the content delivered in a boot camp. Coding boot camps originated in Silicon Valley, run by the industry to teach only what was current and relevant for new coding initiates. These courses have been popping up all over the world and provide an education opportunity for those who want to learn about the tools they will be using on a daily basis as a junior developer.&lt;/p&gt;

&lt;p&gt;These courses tend to focus on web technologies like HTML, CSS, JavaScript, Git, a front end framework (typically React) as well as some SQL and database design. Additionally, you are likely to glean many key tips about how to ace coding interviews (aimed at junior roles) without having to cram coding interview practice before the big day. &lt;/p&gt;

&lt;h2&gt;
  
  
  Community
&lt;/h2&gt;

&lt;p&gt;There are a number of advantages that come directly from the people you study with. &lt;/p&gt;

&lt;p&gt;When you are surrounded by people who are on the same journey, it is significantly easier to get help when you need it. While it is possible to find online communities, it just isn't quite the same. You will have peers that are coming across the same problems and have found a way to solve it that they are willing to share with you. Alternatively, you will always be able to ask your lecturers and educators who typically have a wealth of experience to draw from. This support network will significantly reduce the learning burden that comes with solving every single problem you face by yourself. &lt;/p&gt;

&lt;p&gt;It may not be the case for everyone, but I certainly find it easier to stay motivated and commit to the task at hand when I am part of a group. There is an intrinsic level of competitiveness that helps drive my behaviour towards delivering my best work. I also found the work my peers would deliver and present gave me insight into novel solutions to problems I hadn't yet encountered as well as inspiration for future projects.&lt;/p&gt;

&lt;p&gt;Finally, a more long term benefit, you will have met a group of developers that make their way into many different areas in the industry (or other industries entirely). These connections will be invaluable, as you will be in the loop for any new job opportunities that appear before they are posted on sites like &lt;a href="https://www.linkedin.com/jobs/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://www.seek.com.au/"&gt;Seek&lt;/a&gt; and other job boards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenge
&lt;/h2&gt;

&lt;p&gt;A boot camp provides students a well-defined structure of increasing project difficulty. Whenever I looked back at the previous week, I was consistently blown away by how much I had learned. It was truly exponential, and what I considered really difficult at the time became totally trivial in a matter of days.&lt;/p&gt;

&lt;p&gt;I was luckily able to escape the dreaded 'tutorial purgatory' by joining a course where I was given larger projects to sink my teeth into, with specific requirements that provided scope and direction, support from my peers and educators as well as deadlines and goals to drive my learning momentum at a rapid pace. For more reading on breaking down your first small projects, check out this guide on &lt;a href="https://dev.to/peterlunch/how-to-plan-and-build-a-programming-project-a-legitimate-guide-for-beginners-1fll"&gt;How to Plan and Build a Programming Project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While there are many good reasons to enroll in a boot camp, one should nevertheless be aware of the following considerations:  &lt;/p&gt;

&lt;h2&gt;
  
  
  Cost
&lt;/h2&gt;

&lt;p&gt;Boot camps ain’t cheap. While they are a slightly lower cost option than traditional degrees you are still likely to need a HELP debt loan to cover the course fees. &lt;/p&gt;

&lt;p&gt;This may be the primary reason many consider the self-taught route, but in my experience, it was worth every cent. &lt;/p&gt;

&lt;h2&gt;
  
  
  Time
&lt;/h2&gt;

&lt;p&gt;The head start you get in your education by learning from industry experts is unparalleled and will save a significant amount of time in the long run. &lt;/p&gt;

&lt;p&gt;While not impossible, it is incredibly unlikely you will be able to learn at the same pace in a self-taught environment. Studying at a boot camp will allow you to start your professional development journey sooner, leading to an earlier salary start date and earlier access to promotions. In most cases, this acceleration will translate to a larger financial benefit across an entire career than the initial cost of the boot camp course fees. &lt;/p&gt;

&lt;h2&gt;
  
  
  Discipline
&lt;/h2&gt;

&lt;p&gt;For all the advantages boot camps bring, there is one factor that will dictate your ultimate success. Make no mistake, boot camps are &lt;strong&gt;hard work&lt;/strong&gt;! Speaking from my own experience, what I’ve seen from my peers and read from previous students, to do well requires 60-70 hours per week (in a 6 month, full time course). It is a sure fire way to burn out if you don’t prepare a self-care routine in advance. If you aren’t able to dedicate this much time to a course, you may still be able to graduate, but as the saying goes, you only get out what you put in. &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;Comparison With Other Forms of Learning&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Universities
&lt;/h3&gt;

&lt;p&gt;Universities are a very traditional form of education, steeped in history. They date back to the original Platonic Academy of Greece in 387 BCE, and now form the bedrock of tertiary education in most countries around the world.&lt;/p&gt;

&lt;p&gt;Due to their large size and moderately antiquated ways of working, a course syllabus will typically be updated every 3 years. For some perspective, there were 17 brand new programming languages developed and 11 framework releases in the 3 years leading up to 2014. &lt;/p&gt;

&lt;p&gt;In contrast, the internet is less than 40 years old, and changes more frequently than the average job tenure of a millennial. Learning modern web-based skills in this traditional environment is likely to provide you a deep understanding of computing theory but put you behind the 8-ball in practical skills.&lt;/p&gt;

&lt;p&gt;A drawback of trying to follow the traditional education path is the high bar set for entry. In Australia, most universities require a minimum ATAR of more than 90 (the 90th percentile of high school graduates) in order to be accepted into a program. As ATAR requirements tend to be driven by popularity more than technical difficulty, there are plenty of people who would be perfectly capable programmers that will never be accepted into bachelor of computer science.&lt;/p&gt;

&lt;p&gt;On the other hand, for all of those that make it into a bachelor, a key benefit of studying at university is the ‘prestige factor’. Even though a large number of employers are starting to rethink the hard requirement of a degree for recruiting new hires, many still value traditional degrees over any other type of qualification. &lt;/p&gt;

&lt;h3&gt;
  
  
  Self-Taught
&lt;/h3&gt;

&lt;p&gt;With the rise in short online courses at basement bargain prices, it is becoming increasingly popular to study online. It is even possible to learn everything you would find in a boot camp or bachelor degree syllabus online for free, if you know where to look. &lt;/p&gt;

&lt;p&gt;The obvious problem for developers just getting started, is they won’t know where to look, how to read the technical documentation, what topics should take priority in their learning journey or whether you are progressing at a reasonable pace. Even if you could determine all of this on your own, there are so many areas in the industry you can branch into, there is no real way of knowing which languages and frameworks to focus on until you get there. It is also likely to take some time AFTER your first gig as a developer before you find exactly which type of programming you enjoy most. &lt;/p&gt;

&lt;p&gt;A large barrier to measurable learning progress as a self-taught programmer is having no concrete accountability. If you haven’t invested much money into your education, you have no skin in the game. This makes it so much harder to stay motivated when faced with challenges (of which there will be plenty) and all the more likely you will abandon the idea of becoming a dev all together.&lt;/p&gt;

&lt;p&gt;Probably the most dangerous and unanticipated factor in the journey of a self-taught programmer is the potential for a false sense of security. In the lead up to starting my boot camp, I bought a subscription to &lt;a href="https://www.codecademy.com/"&gt;codecademy.com&lt;/a&gt; (a fantastic resource for learning new programming languages). I remember feeling a monumental sense of achievement whenever I finished one of the course topics and any of the small projects in each module. In hindsight, these small wins were so insignificant compared to what I built and achieved during my time at the boot camp and would have prevented me from seeing how much more I needed to learn before I was ready to take on my first professional role. After learning HTML, CSS / SASS, Git, Ruby on Rails, PostgreSQL, RESTful APIs, JavaScript and React, I still feel I was barely prepared for my first role as a front end developer (which is widely regarded by most developers as the less technical cousin of back end development).&lt;/p&gt;

&lt;p&gt;If you are able to stay motivated and disciplined, get by with a few low cost courses and subscriptions and find a well-laid out blueprint for your learning journey, it is possible to skip all of the education debt outright. If you choose this road it will be incredibly challenging, but anything worth doing is never easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Everyone has a different situation, with different priorities and challenges to face, but if you are still reading and haven't been deterred by any of the points above I would highly recommend enrolling in a boot camp as soon as possible. They are definitely not for everyone, but there are a number of different courses to choose from with different options for flexible study. If you are dedicated, enthusiastic and committed you will go very far, and nothing will be able to stop you from reaching your goals. I wish you all the best on your coding journey, and regardless of which route you take to get into the industry, the learning in this profession never stops.&lt;/p&gt;

</description>
      <category>education</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Beginner’s Guide to 3D Rendering with JavaScript: Part One — The Setup</title>
      <dc:creator>waldowred5</dc:creator>
      <pubDate>Thu, 15 Apr 2021 12:15:38 +0000</pubDate>
      <link>https://dev.to/waldowred5/getting-started-with-your-first-three-js-project-part-one-the-setup-147k</link>
      <guid>https://dev.to/waldowred5/getting-started-with-your-first-three-js-project-part-one-the-setup-147k</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/waldowred5/embed/QWdNVqY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  What is three.js?
&lt;/h1&gt;

&lt;p&gt;three.js is a powerful JavaScript library and API allowing developers to create incredible 2D and 3D graphics that are animated in the browser without plugins (using &lt;a href="https://get.webgl.org/" rel="noopener noreferrer"&gt;WebGL&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;To check out some of the amazing projects created by talented developers, you can check them out at the &lt;a href="https://threejs.org/" rel="noopener noreferrer"&gt;three.js&lt;/a&gt; homepage, as well as many advanced guides on getting the most out of the library.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are we building?
&lt;/h1&gt;

&lt;p&gt;In the header above (after clicking ‘Run Pen’), you can see a live demo of the animation we will be building in this tutorial. It is a cube that spins slowly, with four small spheres orbiting it at a much faster pace, each on its own orbital path. It is also brightly coloured because monochrome is drab.&lt;/p&gt;

&lt;p&gt;Users also have the ability to spin the cube and spheres in any direction they want!&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;Before we start, lets get our project setup first. Create a project directory somewhere that is easy to reach with your terminal. The way I’ve structured my directory looks like this (important so the import paths work properly):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

/first_threejs_project
|__ /css
|__ |__ main.css
|__ /js
|__ |__ main.js
|__ index.html


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Type the following commands in your terminal to get your project directory setup correctly (don’t forget to press the ‘Enter’ key between each line):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir first_threejs_project
cd first_threejs_project
mkdir css js
touch index.html
cd css
touch main.css
cd ../js
touch main.js


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx61rjircv7dpdw82lp18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx61rjircv7dpdw82lp18.png" alt="Directory Structure"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Your directory should now look something like this&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;You can setup your HTML and CSS any way you prefer, or you can use the following code as templates to work from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index.html&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;”en”&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;    
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My First three.js Project&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css/main.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    // This line imports our javascript code from our /js directory
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;main.css&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;canvas&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now that we have our initial files ready to go, we need to import the three.js library into our project. There are a few ways to do this, all of which can be found in the three.js &lt;a href="https://threejs.org/docs/#manual/en/introduction/Installation" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt;, but the best way takes a few steps:but the best way takes a few steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your terminal and navigate to your main project directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are using node package manager (npm) enter the following into your terminal:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm install --save three&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, if you are using yarn, enter:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn add three&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(If neither of these commands work or make sense to you, you will probably need to download &lt;a href="https://www.npmjs.com/get-npm" rel="noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://classic.yarnpkg.com/en/docs/install/#windows-stable" rel="noopener noreferrer"&gt;yarn&lt;/a&gt; here).&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This should have added a series of directories to your main project directory. Inside the /&lt;strong&gt;node_modules&lt;/strong&gt; directory is the /&lt;strong&gt;three&lt;/strong&gt; directory. If you open this, you will see the /&lt;strong&gt;build&lt;/strong&gt; directory which includes the core library files you need to import into your code. The core library files include only the most important parts of the library, so to include other useful three.js features we will need to import them from another directory (which has already been downloaded for us during installation). These can be found in the sub-directory /&lt;strong&gt;examples&lt;/strong&gt;/&lt;strong&gt;jsm&lt;/strong&gt;, which includes controls, loaders and some post-processing effects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only one step left to finalise before creating our first scene. Head to your favourite code editor and open up the &lt;strong&gt;main.js&lt;/strong&gt; file. At the top of the file, you will want to write the following two lines of code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;main.js&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../node_modules/three/build/three.module.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TrackballControls&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../node_modules/three/examples/jsm/controls/TrackballControls.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;These two import statements above give our &lt;strong&gt;main.jss&lt;/strong&gt; file access to the:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;three.js core library&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trackball controls module which will allow us to use our mouse to click and drag to spin our animation in any direction&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Creating Your First Scene
&lt;/h1&gt;

&lt;p&gt;Everything is now set up and ready to go for our first lines of three.js code! Every animation (or ‘scene’) we create needs three crucial objects:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Scene: A parent object where we place all of our rendered objects, lights and cameras&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Camera: An object that allows us to see our other objects. There are a few types of cameras, but the one that we want for standard perspective rendering is the &lt;strong&gt;PerspectiveCamera&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Renderer: An object that renders our scene for us with the WebGL API&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The code for these three objects looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scene&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PerspectiveCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebGLRenderer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;antialias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now let’s take a deeper dive into these three lines of code so we can understand what is going on under the hood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Scene: Pretty simple, we are creating a new three.js scene object to place everything&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Camera: As mentioned before, we have created a &lt;strong&gt;PerspectiveCamera&lt;/strong&gt;, which takes four parameters (in order):&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnodkpc8xqclrumeu6u3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnodkpc8xqclrumeu6u3s.png" alt="Field of View Diagram"&gt;&lt;/a&gt;&lt;br&gt;
&lt;sup&gt;Source: &lt;a href="https://www.researchgate.net/figure/Camera-perspective-To-illustrate-the-camera-frustum-manipulation-we-create-two-separated_fig5_216127594" rel="noopener noreferrer"&gt;ResearchGate&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Field of View (FOV): This is a number (in degrees) which represents the vertical FOV (see diagram left)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Aspect Ratio: This is the ratio between the width and height of the scene (width divided by height). Most of the time we want to set this to the width and height of our window so we don’t ‘squish’ the objects in our scene. In this case, we use the &lt;strong&gt;.innerWidth&lt;/strong&gt; and &lt;strong&gt;.innerHeight&lt;/strong&gt; properties of the window object (the window that contains the main DOM document element of our HTML)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Near Clipping Plane: The boundary plane closest to the camera. Anything closer to the camera than this value won’t be rendered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Far Clipping Plane: The boundary plane furthest from the camera. Anything further from the camera than this value won’t be rendered&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Tip: If you set the Far Clipping Plane to be equal or less than the Near Clipping Plane, nothing will be rendered. Don’t be that dev.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Renderer: Here we create a WebGL renderer object to render our objects. While this function can be called without any arguments, we can also pass an object with any settings we want to change from the default behaviour.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnm3xsspwmhdivp55z9jy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnm3xsspwmhdivp55z9jy.gif" alt="Antialiasing Diagram"&gt;&lt;/a&gt;&lt;br&gt;
&lt;sup&gt;Source: &lt;a href="https://3dprint.com/253260/what-is-metrology-part-17-antialiasing/" rel="noopener noreferrer"&gt;3dPrint.com&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In our case, we have changed the antialias property from false to true. See diagram (left) for an example of what our scene will look like with or without anti aliasing&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;The last three lines of code we need for the initial scene creation are:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setClearColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#233143&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;.setClearColor:&lt;/strong&gt; Our first line sets the colour of the scene background (in this case a HEX value passed as a string). You can optionally pass a float between 0 and 1 to the second parameter (known as the alpha) to set the opacity&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;.setSize:&lt;/strong&gt; This sets the size of our app, in our case we want to fill the whole window so we set the width and height to the &lt;strong&gt;.innerWidth&lt;/strong&gt; and &lt;strong&gt;.innerHeight&lt;/strong&gt; properties of the window object again. You can use smaller values if you only want your app to take up part of the window. For example, &lt;strong&gt;renderer.setSize(window.innerWidth/2, window.innerHeight/2)&lt;/strong&gt; would display our app at 50% of the size of our window&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;.appendChild:&lt;/strong&gt; This line adds the renderer to our HTML document as a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; element which is responsible for drawing our objects and animations with the WebGL API.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  A note on responsive design:
&lt;/h3&gt;

&lt;p&gt;When creating web applications it is important to develop for all devices, from smartphones to tablets and 4K desktop monitors. This is already taken care of for us by the &lt;strong&gt;.setSize()&lt;/strong&gt; function for the native screen size of the device.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What if the user changes the size of their window on a desktop or laptop?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkta2xhy1yo6u7mxedb53.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkta2xhy1yo6u7mxedb53.PNG" alt="Rendering Error"&gt;&lt;/a&gt;&lt;br&gt;
&lt;sup&gt;Our cube gets cut off when the window size changes&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Our render will be stuck in the center of the screen and become covered, instead of matching the new size of the window. To solve this problem, we need to add an event listener to the window for ‘resizing’ so that we can recalculate the window size for our canvas if a user changes the size of their window.&lt;/p&gt;

&lt;p&gt;We can get around this problem with the following code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resize&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aspect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateProjectionMatrix&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, we change the size of the canvas back to the size of the window, as well as resetting the aspect ratio to match. Finally we call the &lt;strong&gt;.updateProjectionMatrix()&lt;/strong&gt; function to apply the new changes.&lt;/p&gt;

&lt;p&gt;With all of the code we have added so far, you should have something like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;main.js&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../node_modules/three/build/three.module.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TrackballControls&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../node_modules/three/examples/jsm/controls/TrackballControls.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Scene&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scene&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Camera&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PerspectiveCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Renderer&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebGLRenderer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;antialias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setClearColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#233143&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Make Canvas Responsive&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resize&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aspect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateProjectionMatrix&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We now have our environment completely set up, including a scene, a camera and a renderer to draw everything for us. Don’t panic if you can’t see anything, we haven’t built anything to be rendered yet.&lt;/p&gt;

&lt;p&gt;To see how we go about building the rest of the animation, head over to the &lt;a href="https://medium.com/nerd-for-tech/getting-started-with-your-first-three-js-project-part-two-the-build-3fd9a2f21418" rel="noopener noreferrer"&gt;second part of this tutorial&lt;/a&gt;. See you there!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffnl0od8uzpf0ccbodci3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffnl0od8uzpf0ccbodci3.png" alt="Cube"&gt;&lt;/a&gt;&lt;br&gt;
&lt;sup&gt;We will be building these objects very soon!&lt;/sup&gt;&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>animation</category>
      <category>tutorial</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
