A Virtual World - JavaScript Course: Lesson 4 / 11 [Polygon Operations in JavaScript]

Pubblicato il: 13 ottobre 2023
sul canale di: Radu Mariescu-Istodor
10,108
266

Welcome to the course where we build a self-driving car simulation in a virtual world. In this video we'll learn a technique using geometry to wrap the graph segments in what I like to call envelopes: polygons surrounding the segment in a certain way.

These envelopes have extra points that give them a smooth, rounded appearance. We'll explore how to compute the union of these polygons to retain only the outer segments, resulting in visually pleasing and seamless road borders. Not only does this approach make your roads look more professional, but it also minimizes the number of clicks required in the editing process, making world building a satisfying endeavor.

Have Fun! :-) 🛣️

⭐PLAYLIST⭐
   • Self-driving Car :: Phase2️⃣  

⭐FINAL APP⭐
https://radufromfinland.com/projects/...

💻CODE💻
https://github.com/gniziemazity/virtu...
3. Dynamic Viewport = follow along
4. Roads = code after this lesson

💻COPY CODE FROM HERE💻
https://radufromfinland.com/projects/...

⭐ALL PREREQUISITES⭐
   • Math & Code Fundamentals  

⭐My Video on 2D Vectors⭐
   • Learn 2D Vectors with JavaScript  

⭐My Video on Segment Intersection⭐
   • Segment intersection formula explained  

⭐My Video on Interpolation⭐
   • Linear Interpolation (Lerp) - Math and Jav...  

☕Buy me a Coffee?☕
https://www.buymeacoffee.com/radum

⚡️Join this Channel⚡️
https://youtube.com/@radu/join

⭐Timestamps⭐
00:00 Introduction
01:07 Polygon Class
04:45 Polygon Envelopes
11:04 Roundness
16:45 World Class
20:35 Finding Intersections
35:22 Polygon Union
39:22 Point in Polygon Check
43:24 Styling


In questa pagina del sito puoi guardare il video online A Virtual World - JavaScript Course: Lesson 4 / 11 [Polygon Operations in JavaScript] della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Radu Mariescu-Istodor 13 ottobre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 10,108 volte e gli è piaciuto 266 spettatori. Buona visione!