<?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>Forem: dhondup</title>
    <description>The latest articles on Forem by dhondup (@titungdup).</description>
    <link>https://forem.com/titungdup</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%2F126521%2Ffefe62c5-6072-43dd-9cfb-012e78bd14f8.jpg</url>
      <title>Forem: dhondup</title>
      <link>https://forem.com/titungdup</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/titungdup"/>
    <language>en</language>
    <item>
      <title>Create our first 3D scene using Three.js</title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Fri, 21 Jul 2023 10:31:19 +0000</pubDate>
      <link>https://forem.com/titungdup/create-our-first-3d-scene-using-threejs-gb7</link>
      <guid>https://forem.com/titungdup/create-our-first-3d-scene-using-threejs-gb7</guid>
      <description>&lt;p&gt;As Lao Tzu said, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The journey of a thousand miles begins with one step”. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Created my first 3D scene using threejs. I also added the ability to rotate and zoom the 3D object. I mostly followed the &lt;a href="https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene"&gt;official threejs doc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Demo:&lt;br&gt;
(Drag to rotate and Scroll to zoom)&lt;br&gt;
&lt;iframe src="https://codesandbox.io/embed/scene-with-orbit-control-6f3sz6"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Things I Learned
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scene, Camera and Renderer
&lt;/h3&gt;

&lt;p&gt;Threejs requires three things to display content: &lt;strong&gt;scene&lt;/strong&gt;, &lt;strong&gt;camera&lt;/strong&gt; and &lt;strong&gt;renderer&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scene&lt;/strong&gt; - Allows you to set up what and where to be rendered.&lt;br&gt;
&lt;strong&gt;Camera&lt;/strong&gt; - A viewport through which we observe the 3D scene. There are many types of camera in Three.js like PerspectiveCamera, OrthographicCamera, CubeCamera, etc. Perspective Camera is the most widely used which shows the objects in more realistic perspective view.&lt;br&gt;
&lt;strong&gt;Renderer&lt;/strong&gt; - Renderer is responsible for showing the 3D objects on a web browser. Mostly used WebGLRenderer.&lt;/p&gt;

&lt;h3&gt;
  
  
  BoxGeometry, MeshBasicMaterial and Mesh
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;BoxGeometry&lt;/strong&gt; - Geometry defines the shape and structure of 3D objects in a scene. There are several types of predefined geometries in threejs such as, BoxGeometry, SphereGeometry, CircleGeometry, ConeGeometry, CylinderGeometry, etc. BoxGeometry is used to create a cube.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MeshBasicMaterial&lt;/strong&gt; - A material for drawing geometries in a simple shaded(flat or wireframe) way. This material is not affected by lights.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mesh&lt;/strong&gt; - An object that takes a geometry and applies a material to it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Threejs Addons: OrbitControls
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;OrbitControls Addon&lt;/strong&gt; allows the camera to move around a target. This addon enable us to rotate and zoom our object by dragging and scrolling.&lt;/p&gt;

&lt;p&gt;That's a good start for now. Feel free to play around in codesandbox. Stay tuned.&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>webgl</category>
      <category>learning</category>
    </item>
    <item>
      <title>Learn WebGL and Three.js with me</title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Fri, 21 Jul 2023 02:29:25 +0000</pubDate>
      <link>https://forem.com/titungdup/learn-webgl-and-threejs-with-me-4h63</link>
      <guid>https://forem.com/titungdup/learn-webgl-and-threejs-with-me-4h63</guid>
      <description>&lt;p&gt;Who don't love those amazing &lt;a href="https://www.awwwards.com/"&gt;Awwwards&lt;/a&gt; nominated websites? I am sure we all do. I have always been captivated by the creativity of these websites. And as a Frontend Developer, I have always wanted to created similar websites. So, I have decided to go on a learning journey to build such amazing websites. I have previous experience of building interactive websites(&lt;a href="https://www.bhoos.com/"&gt;Link&lt;/a&gt;) using GSAP and I want to take it to the next level. So, Join me on this exciting learning journey. Together, We will explore CSS animations, GSAP, WebGL, Three.js and other animation tools. &lt;/p&gt;

&lt;p&gt;Feel free to share your experience, learning resources or any suggestions. &lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;

</description>
      <category>webgl</category>
      <category>threejs</category>
      <category>animations</category>
    </item>
    <item>
      <title>You no longer need to import React from 'react'</title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Fri, 02 Apr 2021 03:05:38 +0000</pubDate>
      <link>https://forem.com/titungdup/you-no-longer-need-to-import-react-from-react-3pbj</link>
      <guid>https://forem.com/titungdup/you-no-longer-need-to-import-react-from-react-3pbj</guid>
      <description>&lt;p&gt;If you use React, &lt;code&gt;import React from 'react'&lt;/code&gt; is the first thing that you write in your code but if you have created a new react app using &lt;em&gt;creat-react-app&lt;/em&gt; recently, you might have noticed that there is no import React statement at the top and your code works just fine. So, How's that working?&lt;/p&gt;

&lt;p&gt;Well, previously you had to import React because the JSX is converted into regular Javascript that use react's &lt;code&gt;React.createElement&lt;/code&gt; method.&lt;br&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%2Foql3gz9vcrdh0sdili1v.jpg" 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%2Foql3gz9vcrdh0sdili1v.jpg" alt="JSX conversion"&gt;&lt;/a&gt;&lt;br&gt;
But, React has introduced a new JSX transform with the release of React 17 which automatically transforms JSX without using &lt;code&gt;React.createElement&lt;/code&gt;. This allows us to not import React, however, you'll need to import React to use Hooks and other exports that React provides. But if you have a simple component, you no longer need to import React. All the JSX conversion is handled by React without you having to import or add anything.&lt;/p&gt;

&lt;p&gt;This new JSX transform is also supported in older versions of React so you can start using them even if you don't use React 17.&lt;/p&gt;

&lt;p&gt;Read the official &lt;a href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html" rel="noopener noreferrer"&gt;React doc&lt;/a&gt; to learn more.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>jsx</category>
    </item>
    <item>
      <title>How your work as a web/software developer/designer have helped your clients and their business? </title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Sat, 02 Jan 2021 13:26:46 +0000</pubDate>
      <link>https://forem.com/titungdup/how-your-work-as-a-web-software-developer-designer-have-helped-your-clients-and-their-business-5gj3</link>
      <guid>https://forem.com/titungdup/how-your-work-as-a-web-software-developer-designer-have-helped-your-clients-and-their-business-5gj3</guid>
      <description>&lt;p&gt;Has your work helped the clients increase their revenue, help them cut down costs, increase their customers etc?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>wevdev</category>
    </item>
    <item>
      <title>Do you still use "position" to center align vertically and horizontally? </title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Thu, 16 Jan 2020 12:54:34 +0000</pubDate>
      <link>https://forem.com/titungdup/do-you-still-use-position-to-center-align-vertically-and-horizontally-a6o</link>
      <guid>https://forem.com/titungdup/do-you-still-use-position-to-center-align-vertically-and-horizontally-a6o</guid>
      <description>&lt;p&gt;It's 2020 and we have amazing flex and grid method to center align items both horizontally and vertically. I wonder anyone still use position absolute to center align items? If yes, when and why do you use them?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>css</category>
      <category>layout</category>
    </item>
    <item>
      <title>Can anyone help me find all CSS properties with their values in JSON format? </title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Wed, 08 Jan 2020 09:51:12 +0000</pubDate>
      <link>https://forem.com/titungdup/can-anyone-help-me-find-all-css-properties-with-their-values-in-json-format-55fb</link>
      <guid>https://forem.com/titungdup/can-anyone-help-me-find-all-css-properties-with-their-values-in-json-format-55fb</guid>
      <description>&lt;p&gt;So far i have found this &lt;a href="https://github.com/brianloveswords/hacktionary/blob/71e7d5b6d6edfddbd9355dcd67780a576e207cee/css-properties.json"&gt;this&lt;/a&gt; and &lt;a href="https://github.com/johno/css-properties/blob/master/w3c-css-properties.json"&gt;this&lt;/a&gt; but there are no values available.&lt;/p&gt;

</description>
      <category>help</category>
      <category>css</category>
    </item>
    <item>
      <title>What do you think about nested styles in Styled Components?</title>
      <dc:creator>dhondup</dc:creator>
      <pubDate>Mon, 06 Jan 2020 11:09:53 +0000</pubDate>
      <link>https://forem.com/titungdup/what-do-you-think-about-nested-styles-in-styled-components-3pdf</link>
      <guid>https://forem.com/titungdup/what-do-you-think-about-nested-styles-in-styled-components-3pdf</guid>
      <description>&lt;p&gt;For example I have nested styled component for a navbar like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Navbar = styled.nav`
    // some style 
    .logo{ 
        // logo style 
    } 
    .nav-items{ 
        //nav-items styles 
    } 
    .nav-item{ 
    // list styles 
}`
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I am only defining one styled component and using that as a base to style other elements of the navbar with nested style. Sometimes the nested style inside the styled components gets very large with many classes which might be difficult to read. &lt;br&gt;
I looked at &lt;a href="https://github.com/withspectrum/spectrum/blob/alpha/src/views/channel/style.js"&gt;spectrum code&lt;/a&gt; and found that they almost never nest style inside styled component. Is it a bad practice to use nested style inside styled component? Should i create styled component for each elements like logo, nav-items? What are your thoughts?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>styledcomponents</category>
      <category>css</category>
    </item>
  </channel>
</rss>
