<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Artem Zubkov on Medium]]></title>
        <description><![CDATA[Stories by Artem Zubkov on Medium]]></description>
        <link>https://medium.com/@artzub?source=rss-9475cd662394------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Opodt0s1NXUWDkLTu52N7g.jpeg</url>
            <title>Stories by Artem Zubkov on Medium</title>
            <link>https://medium.com/@artzub?source=rss-9475cd662394------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 16:42:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@artzub/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[YouTube: make a watch later playlist from subscriptions]]></title>
            <link>https://medium.com/spaceport-on-the-knee/youtube-make-a-watch-later-playlist-from-subscriptions-34eefc7e2de6?source=rss-9475cd662394------2</link>
            <guid isPermaLink="false">https://medium.com/p/34eefc7e2de6</guid>
            <category><![CDATA[life-hacking]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[snippet]]></category>
            <dc:creator><![CDATA[Artem Zubkov]]></dc:creator>
            <pubDate>Mon, 13 Dec 2021 09:10:00 GMT</pubDate>
            <atom:updated>2021-12-13T09:20:57.165Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPZmeKfZx0nE9HurNhS5kA.gif" /></figure><p>I’m used to watching my subscriptions in chronological order but it is too boring to prepare a list for watching later.<br>Before I found the solution my algorithm was:</p><ul><li>Open <a href="https://www.youtube.com/feed/subscriptions">subscriptions</a> on YouTube.</li><li>Scroll down to the latest watched video.</li><li>Scroll top and add all not-watched videos to the Watch Later playlist.</li></ul><p>As you can see it takes a lot of time.</p><p>Researching on Internet didn’t give me a done solution. But I found YouTube API and how to use them in App Script from Google Sheets.<br>And now I share my solution.</p><h3>Solution</h3><p>I don’t find an easier way than this. The way consists from to part:</p><ol><li>Collect a list of needed videos for passing in a watch later list.</li><li>And copy and pass the list to a Google Sheet with an app script, that will do creating a new playlist and insert the videos to the playlist.</li></ol><p>I will explain from the second point. <br>Let’s start.</p><h4>Google Sheets and App Script</h4><p>Create a new sheets document in Google Sheets and set a name <strong>YT Subs to WL </strong>or another that you prefer.<br>In the main menu select <em>Extensions &gt; App Script</em> and rename to <strong>YT Subs to WL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*WmYXIACIfAolAIlQiPHYOw.png" /></figure><p>You will see the code editor with a default function. Select all code and remove it.<br>Open this <a href="https://gist.github.com/artzub/02b1b91e5c16a76bdf6c4710dbc105f0#file-app-script-js">file</a> and copy all from it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96af85395209b6c6f6efc2706b702494/href">https://medium.com/media/96af85395209b6c6f6efc2706b702494/href</a></iframe><p>And insert to the editor and press <strong>Save</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*99kd2b3S_O7kuw9buV-8fQ.png" /></figure><p>Click to <strong>Add a service</strong> button (plus near Services).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*B5eF-ojlrGnug1oifmVWCQ.png" /></figure><p>Find and select YouTube Data API v3 and press <strong>Add</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*degN8eHUDUJTZCQRcV9B5g.png" /></figure><p>Select init function in the tooltip bar and press <strong>Run</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*yOE-zvBGdFbftdkzG5qCNA.png" /></figure><p>This action will run the script and add to the sheet a new menu’s item: YouTube.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*RZwcwWaFpcwYb3QsbVkblA.png" /></figure><p>Besides, Google will ask you about permissions, do review permissions to allow your app access to your account YouTube and the sheet. Google can note that this application is not verified, you should click by Advance link and click by appeared link.</p><p>The next step is to add a trigger in order for the script to work automatically.<br>Click <strong>Triggers</strong> in the left sidebar navigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*vfKng8wMJE2l7SXMl2y24Q.png" /></figure><p>Add Trigger:</p><ul><li>Choose which function to run: run .</li><li>Select event source: Time-driven .</li><li>Select type of time based trigger: Day timer .</li><li>And also you can select a time of day that you perfer.</li><li>Press Save.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*qObatbutLWKEaO2tC3yMLQ.png" /></figure><p>The app script is prepared. <br>The next step is to configure a snippet for YouTube subscriptions page.</p><h4>Snippet for YouTube subscriptions page</h4><p>I hope that you understand that I talk about snippets in Google Chrome DevTools. <br>This technology lets us run a saved script on a page without having to insert it into the console every time.<br>My script works with YouTube subscriptions page version of 13.12.2021.</p><p>Seems to have made all the necessary comments. <br>let’s continue.</p><p>Go to <a href="https://www.youtube.com/feed/subscriptions">subscriptions</a> (<a href="https://www.youtube.com/feed/subscriptions">https://www.youtube.com/feed/subscriptions</a>) page.<br>And open DevTools (F12).<br>In the Source tab to find the Snippets in the left side panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2RCG6nVbRkCmZRyCn2X_w.png" /></figure><p>Click by <strong>+ New Snippet</strong>. Type a name that you like.</p><p>Open this <a href="https://gist.github.com/artzub/02b1b91e5c16a76bdf6c4710dbc105f0#file-snippet-js">file</a> and copy code to the created snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82bf9c975f48ae58b38ab1bc2e544ea7/href">https://medium.com/media/82bf9c975f48ae58b38ab1bc2e544ea7/href</a></iframe><p>Now, need to find a video (e.g. the latest watched) and open it.<br>Copy the video id from URL /watch?v=<strong>someVideoId </strong>in the open tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*7nmI7lRS-VYhGY66zj-ZYQ.png" /></figure><p>Go back to <a href="https://www.youtube.com/feed/subscriptions">subscriptions</a>. <br>And open DevTools and the snippet.<br>Run the snippet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*L0oglouSe-qXnnZbe414Ww.png" /></figure><p>And paste the copied video id to the confirm dialog and press Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*ledaa77WeglLMxNE5FndXw.png" /></figure><p>The script will prepare a list of videos in the current tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*VQfA6F33Cyr-K5mImIUZcA.png" /></figure><p>Select all and copy.<br>Go to the sheet and paste the list to the <strong>A</strong> column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*aPSnmsHaqu_gio4BGYh_5Q.png" /></figure><p>And the end you can try to run the app script from the main menu <em>YouTube &gt; fill playlist.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*TkeIckiPEyvl4kya1MrJVw.png" /></figure><p>But normally it will be automatic every day because we have a limit of only 200 videos per day.</p><blockquote>Note: After the playlist is created you should change the list sorting in order to items for watching will be in the correct order.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6eh2eGS8n8KPKJmEV4rIHQ.png" /></figure><h3>How does it work</h3><p>I would like to give some explanation of how scripts work.</p><p>About the app script:</p><ul><li>Every day by the trigger our app script selects down from the Google sheet 200 items beginning from the A1 cell. As I said before Google give us a quote for inserting just 200 items. More information about quotes is in <a href="https://developers.google.com/youtube/v3/getting-started?authuser=0#quota">the documentation</a>.</li><li>Creates a playlist with the name wl__currentMonth if this list doesn’t exist.</li><li>And after that, insert all available videos into the playlist.</li><li>When the videos are inserted, the script removes this item from the column and pushes to the B1 cell the latest inserted video id for the next searching.</li><li>If the script catches an error you will have a notification about that. The script skips just the error about videos that are not available, others errors will stop the script and you will receive notifications. I tried to do the working of the script safe in order to you don’t lose any videos.</li></ul><p>About the snippet:</p><ul><li>The snippet finds the element with a loading identification.</li><li>Scrolls to it and collects all videos ids</li><li>If don’t find your passed video id, then will continue scrolling until don’t find the video id.</li><li>When the video is found, the snippet replaces the subscriptions page with the list of prepared videos ids.</li></ul><p>I hope the article is useful for you.<br>If you find a way to optimize my solution, then welcome comments.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34eefc7e2de6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spaceport-on-the-knee/youtube-make-a-watch-later-playlist-from-subscriptions-34eefc7e2de6">YouTube: make a watch later playlist from subscriptions</a> was originally published in <a href="https://medium.com/spaceport-on-the-knee">Spaceport on the knee</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom outline for focus and hover]]></title>
            <link>https://medium.com/spaceport-on-the-knee/custom-outline-for-focus-and-hover-bc1ab7f4eea1?source=rss-9475cd662394------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc1ab7f4eea1</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[outline]]></category>
            <dc:creator><![CDATA[Artem Zubkov]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 06:20:47 GMT</pubDate>
            <atom:updated>2021-01-13T07:07:15.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*AtKMa8tMUlhI3FBK2RD1kA.gif" /></figure><p>Recently, more and more often there is a question about accessibility, if earlier hiding outlines for page’s elements was a general rule, now a good site should have outlines on the elements, at least <strong>:focus-visible</strong>.</p><p>The main problem with outlines is styling them.</p><p>I came to my solution shortly outlined in this article.</p><p>I met an interesting case while working on my pet project.<br>I needed to make the same hover style on visualizations and all focusable DOM items.</p><p><strong>Solution</strong></p><ul><li>Insert in the document body a top-level <strong>div</strong> with <strong>pointer-event: none</strong>, absolute position, a big z-index, and stretching on document sizes.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8def7d4e07da6da0d20f24c362ba9567/href">https://medium.com/media/8def7d4e07da6da0d20f24c362ba9567/href</a></iframe><ul><li>Insert 4 more <strong>div</strong> with the absolute position in the <strong>div </strong>.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d52017a5fcd87a70630e1841492db508/href">https://medium.com/media/d52017a5fcd87a70630e1841492db508/href</a></iframe><p><em>the style in sass:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/777c52e55bfbad42819c1b8af3d4935f/href">https://medium.com/media/777c52e55bfbad42819c1b8af3d4935f/href</a></iframe><ul><li>Add to document a few listeners: <strong>pointerenter</strong> , <strong>pointerleave</strong> , <strong>focus</strong> , <strong>blur</strong> .</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31bde718a3ba20f5c7f8198e27da308f/href">https://medium.com/media/31bde718a3ba20f5c7f8198e27da308f/href</a></iframe><blockquote>Tip: don’t forget to unsubscribe from events, if you do some React app for example.</blockquote><ul><li>Filter all events by <strong>tabIndex &gt; -1</strong> of an event’s target.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e48a553a207970826500508f72300394/href">https://medium.com/media/e48a553a207970826500508f72300394/href</a></iframe><ul><li>Get the hovered target bounding rect by <strong>getBoundingClientRect</strong> .<br>And move the inserted divs to the corners points of the rect.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/796444081ce0f9c8febb93cd5f8637b8/href">https://medium.com/media/796444081ce0f9c8febb93cd5f8637b8/href</a></iframe><p>That is all 😁.</p><p>Full example here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fartzub%2Fembed%2Fpreview%2FoNzMQKM%3Fheight%3D600%26slug-hash%3DoNzMQKM%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fartzub%2Fpen%2FoNzMQKM&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/289b454a254daa10ebc6084c66e3245b/href">https://medium.com/media/289b454a254daa10ebc6084c66e3245b/href</a></iframe><h4>Conclusion</h4><p>How you can see, you can style elements how you want, or even you just one border element, all depends on your imagination.<br>Besides, overflow: hidden doesn&#39;t affect our outline, but sometimes we need to follow an element’s shape, so, you can improve this approach, all in your hands.</p><p>Thanks for reading!</p><p><em>If you want more information let me know about it by DM on </em><a href="https://twitter.com/artzub"><em>twitter.com/artzub</em></a><em> or </em><a href="http://t.me/artzub"><em>t.me/artzub</em></a><em> or </em><a href="/service/mailto:artzub@gmail.com"><em>artzub[at]gmail.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc1ab7f4eea1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spaceport-on-the-knee/custom-outline-for-focus-and-hover-bc1ab7f4eea1">Custom outline for focus and hover</a> was originally published in <a href="https://medium.com/spaceport-on-the-knee">Spaceport on the knee</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Subtractive of Geometries]]></title>
            <link>https://medium.com/spaceport-on-the-knee/subtractive-of-geometries-c3e8d693565d?source=rss-9475cd662394------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e8d693565d</guid>
            <category><![CDATA[threejs]]></category>
            <category><![CDATA[branding]]></category>
            <category><![CDATA[lighting]]></category>
            <category><![CDATA[effect]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Artem Zubkov]]></dc:creator>
            <pubDate>Sat, 08 Apr 2017 20:32:15 GMT</pubDate>
            <atom:updated>2017-04-10T22:49:22.939Z</atom:updated>
            <content:encoded><![CDATA[<p>In my practise I’ve met the issue: how to combinate DOM and WebGL layers in order to keep a feeling 3d scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*C4PtbaA_2ww1X9irsgqedA.gif" /><figcaption>the DOM layer crosses the WebGl scene</figcaption></figure><p>The green makers into the above picture are the DOM elements. How can you see, the WebGL scene is mixed in with the DOM layer.</p><p>How to get the effect, I let you know in the note.</p><h4>Common algorithm</h4><p><em>I hope that my readers’ve been experience with </em><a href="http://threejs.org/"><em>threejs</em></a><em>.</em></p><blockquote>1. Create a <strong>THREE.Scene<br></strong>2. Create a <strong>THREE.HemisphereLight</strong> with arguments: skyColor equals <strong>#fff</strong>, groundColor equals <strong>#aaa</strong> and <strong>intensity</strong> is <strong>25</strong>. Add into the scene.<br>3. Create a <strong>THREE.SphereGeometry</strong> with radius, which you want to cut from view. Set a THREE.MeshPhongMaterial as material for a mesh with any <strong>color</strong>, <strong>transpatent</strong> must be <strong>true</strong> and <strong>blending</strong> parameter must have the <strong>THREE.SubtractiveBlending</strong> value. Add the mesh into the scene.<br>4. And the last, add anything else.</blockquote><p>It’s all algorithm :)<br>But need noticing that mixing lights with blending mode give to us needed result. And only this combination of colors and intensity work fine. If you need lower intensity then you should use brighter color and vice versa.<br>I’ve tried to play with these parameters and have had other interesting results.</p><p>Of cource you can use others kind of geomerties, all depends of your imagination.</p><h4>Let’s try it out</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fartzub%2Fembed%2Fpreview%2FwJjYoj%3Fheight%3D600%26amp%3Bslug-hash%3DwJjYoj%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fartzub%2Fpen%2FwJjYoj&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F13070.wJjYoj.small.48ddbe54-25d6-4428-ab64-9a06c971d207.png&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/376b5798c82824c6d4196a5a3ca2ae49/href">https://medium.com/media/376b5798c82824c6d4196a5a3ca2ae49/href</a></iframe><p>For my solution I know at least two cases:</p><ol><li>My current project, there’s I have to mix different type of DOM elements and a WebGL scene.</li><li><a href="http://kuzhukeev.ru:3000/">My friend’s project</a>, there’s he works with both <a href="http://cesiumjs.org/">cesiumjs</a> and threejs in the same time.</li></ol><p><strong><em>Thank you for reading. If you find this post useful, please click the </em></strong>💚<strong><em>button so this story can reach out to more </em>readers<em>.</em></strong></p><p><em>If you’d like to talk about it or others</em><strong><em> </em></strong><em>let me know about it by PM on </em><a href="https://twitter.com/artzub"><em>twitter.com/artzub</em></a><em>, </em><a href="http://fb.com/artzub"><em>fb.com/artzub</em></a><em> or </em><a href="/service/mailto:artzub@gmail.com"><em>artzub[at]gmail.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e8d693565d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spaceport-on-the-knee/subtractive-of-geometries-c3e8d693565d">Subtractive of Geometries</a> was originally published in <a href="https://medium.com/spaceport-on-the-knee">Spaceport on the knee</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebGL width of Line into the Windows browsers]]></title>
            <link>https://medium.com/spaceport-on-the-knee/webgl-width-of-line-into-the-windows-browsers-f199d7252fc?source=rss-9475cd662394------2</link>
            <guid isPermaLink="false">https://medium.com/p/f199d7252fc</guid>
            <category><![CDATA[threejs]]></category>
            <category><![CDATA[line-drawing]]></category>
            <category><![CDATA[particle]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[computer-graphics]]></category>
            <dc:creator><![CDATA[Artem Zubkov]]></dc:creator>
            <pubDate>Sun, 08 Jan 2017 02:26:19 GMT</pubDate>
            <atom:updated>2017-04-08T20:36:17.911Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*V8NpmInVnFXWv4DvOwpY8w.gif" /></figure><h4>Few words before we start…</h4><p>It’s my first article in <strong>English</strong>, my first article on <a href="https://medium.com/"><strong>medium.com</strong></a> and my first article about <strong>WebGL and </strong><a href="http://threejs.org/"><strong>ThreeJS</strong></a></p><p>I hope that readers know ThreeJS a little bit.</p><blockquote>Of course it might look like <strong>“</strong>reinventing<strong> the wheel”</strong> :) but why not ;)</blockquote><h4>What happened?</h4><p>A couple of days ago I had the problem: how to draw lines with custom width of line on WebGL into the Windows browsers. Currently the Windows browsers support only 1px line width (due to the use of DirectX Angle Layer).<br>You can check it yourself <a href="http://alteredqualia.com/tmp/webgl-linewidth-test/">here</a>.<br>If you take a pause and try to search over the Internet, you will find one of following decisions:</p><ul><li>Using the command line parameter for Chrome: --use-gl=desktop<br><em>It says Chrome should use OpenGL instead of DirectX<br></em><strong>No a common decision.</strong></li><li>Simulating line width by creating triangles. Take more details <a href="http://stackoverflow.com/a/28046235/820262">here</a><br><strong>A more common decision, but it’s not my way :D</strong></li><li>Also you can find a good article <a href="https://mattdesl.svbtle.com/drawing-lines-is-hard">Drawing Lines is Hard</a> of <a href="https://mattdesl.svbtle.com/">MATT DESLAURIERS</a> with his library <a href="https://github.com/mattdesl/webgl-lines">webgl-lines</a><br><strong>Good, but it’s not my choice</strong></li></ul><h4>My solution</h4><p>For my decision I use <a href="https://threejs.org/docs/index.html?q=BufferGeometry#Reference/Core/BufferGeometry">THREE.BufferGeometry</a>, <a href="https://threejs.org/docs/index.html?q=Points#Reference/Objects/Points">THREE.Points</a> and illusion :)<br>I guess we have some BufferGeometry (call it base).<br>The common algorithm:</p><ul><li>Get the position attribute from base.</li><li>Walk by all points into the position attribute.</li><li>On each step, calculate the number of new points between the current point and the previous point depending on the distance between the selected points and the size of the particle.</li><li>Generate new points and add them into the result array.</li><li>Make new THREE.BufferGeometry and add to it the position attribute based on the generated positions array.</li></ul><p>In fact, the following method does everything :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c71c0ffa8e4c9b72befe9405af9f530/href">https://medium.com/media/3c71c0ffa8e4c9b72befe9405af9f530/href</a></iframe><p>Let’s look at an example</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fcodepen.io%2Fartzub%2Fpen%2FVPLEqo&amp;src=https%3A%2F%2Fcodepen.io%2Fartzub%2Fembed%2Fpreview%2FVPLEqo%3Fheight%3D600%26amp%3Bslug-hash%3DVPLEqo%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/1dad755c1199bd2e05ec5e022296cea4/href">https://medium.com/media/1dad755c1199bd2e05ec5e022296cea4/href</a></iframe><p>You can see it looks quite simular to the THREE.Line, but if you try to make double click then you’ll get a different result.<br>The trick is to change the size of the particle.</p><p>In order to calculate the optimum number of points into the geometry, we need to find the optimum blending ratio of particles. The ratio depends on an image template of a particle. For the example I use the following <a href="https://armsglobe.chromeexperiments.com/images/map_mask.png">image</a>. I’ve found that the ratio of my image is 10/SIZE_OF_PARICLE, for another image it’ll be a different value. I understand that it looks quite strange but I’ve not found any better decision for that.</p><h4>What’s next?</h4><p>First and foremost, we’ve almost solved the width problem. Why almost? Because it’s still kludge or dirty hack. But we have an opportunity to make intersting effects.</p><ul><li>Since we can use <a href="https://threejs.org/docs/index.html?q=ShaderMaterial#Reference/Materials/ShaderMaterial">THREE.ShaderMaterial</a>, we can customize the whole drawing process — to make a more advanced shader program.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fcodepen.io%2Fartzub%2Fpen%2FMbMbVY&amp;src=https%3A%2F%2Fcodepen.io%2Fartzub%2Fembed%2Fpreview%2FMbMbVY%3Fheight%3D600%26amp%3Bslug-hash%3DMbMbVY%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/e02da56c4fdeaaafa77245d37d68bc50/href">https://medium.com/media/e02da56c4fdeaaafa77245d37d68bc50/href</a></iframe><ul><li>Also we are able to use different templates of particles.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*Y8BDRDNpdCknLeLD8162iQ.png" /></figure><ul><li>And make a complicated stuctures:</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fartzub%2Fembed%2Fpreview%2FggpZEq%3Fheight%3D600%26amp%3Bslug-hash%3DggpZEq%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fartzub%2Fpen%2FggpZEq&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F13070.ggpZEq.small.983acd91-e7ca-4ac7-a0b6-7e801072271a.png&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/7aa6bacd4c967af45f94a04834fe5939/href">https://medium.com/media/7aa6bacd4c967af45f94a04834fe5939/href</a></iframe><p>I hope someone found the article interesting and helpful.<br>I wait for your comments.</p><p><strong><em>If you liked this article, please click that lovable green ♥ below so others can enjoy it, too.</em></strong></p><p><em>If you want more information let me know about it by PM on </em><a href="https://twitter.com/artzub"><em>twitter.com/artzub</em></a><em> or </em><a href="/service/mailto:artzub@gmail.com"><em>artzub[at]gmail.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f199d7252fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spaceport-on-the-knee/webgl-width-of-line-into-the-windows-browsers-f199d7252fc">WebGL width of Line into the Windows browsers</a> was originally published in <a href="https://medium.com/spaceport-on-the-knee">Spaceport on the knee</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>