A Virtual World - JavaScript Course: Lesson 6 / 11 [Pseudo 3D with JavaScript]

  Рет қаралды 4,769

Radu Mariescu-Istodor

Radu Mariescu-Istodor

Күн бұрын

Welcome to the course where we build a self-driving car simulation in a virtual world.
In this video, we learn a way to make our items 3D. While you could certainly add some sprites to your existing 2D interface, creating a 3D look is a whole different experience.
I've previously demonstrated how to use images for adding cars, and even offered tips for recoloring sprites in previous tutorials. But what if you're aiming for a genuine 3D appearance? You could completely refactor your application to utilize a 3D rendering engine. Like:
⭐ Bretto ported the code from Phase 1 to ThreeJS:
github.com/Bretto/evolution
⭐ @davidmurphy563 ported the code from Phase 1 to Godot:
• Neural Nett II: Attack...
I want to teach you a way to get the 3D look without using a 3D engine because I find this effect visually appealing, and it's surprisingly straightforward to implement.
Beyond the visual aspect, you may also find the underlying mathematics intriguing. While 3D renderers primarily employ triangles or voxels, our focus won't involve these elements. Nonetheless, this exploration touches upon fundamental principles of 3D rendering, providing insights into how these complex systems function.
Have Fun! :-)
⭐PLAYLIST⭐
• Self-driving Car :: Ph...
⭐FINAL APP⭐
radufromfinland.com/projects/...
💻CODE💻
github.com/gniziemazity/virtu...
5. Buildings And Trees = follow along
6. Fake 3D = code after this lesson (including the part for channel members)
⭐ALL PREREQUISITES⭐
• Math & Code Fundamentals
⭐My Video on the Euclidean Distance⭐
• Euclidean Distance: Ma...
☕Buy me a Coffee?☕
www.buymeacoffee.com/radum
⚡️Join this Channel⚡️
youtube.com/@radu/join
⭐Timestamps⭐
00:00 Introduction
01:29 Creating the Tree Object
05:08 Explaining the 3D approach
10:47 Styling the 3D Trees
16:02 'Random' number generation
20:35 Creating the Building Object

Пікірлер: 80
@julianbullmagic
@julianbullmagic 5 ай бұрын
These videos are have some sort of asmr effect. It's calming seeing these complex problems broken down into simple steps.
@Radu
@Radu 5 ай бұрын
Cool, I guess :-D
@catakuri6678
@catakuri6678 6 ай бұрын
i like how you always reply to all comments :)
@Radu
@Radu 6 ай бұрын
Still possible for now, but now sure how long. Starts to take quite a lot of time.
@iShubhamPanchal
@iShubhamPanchal 6 ай бұрын
He always gets us at 1:03 😂
@Radu
@Radu 6 ай бұрын
😎
@juancamacho479
@juancamacho479 6 ай бұрын
My wife won't let me watch unless i play the intro song and sing it :'D
@Radu
@Radu 6 ай бұрын
Oh wow! :-) first time I hear something like that!
@joningram
@joningram 6 ай бұрын
I recently found this series and have worked through all the episodes so far in the last couple of days - I really like how you have structured your code and made sure that there is a working output at the end of each lesson. Very well thought out! I'm surprised at how nicely 'sort by distance from viewpoint' works to resolve all the draw-order issues.
@Radu
@Radu 6 ай бұрын
Thanks :-) The sorting does a good job, but it's not perfect. You can find some situations where it doesn't perform as expected... especially if you generate really long buildings. But for this kind of project, it's alright :-)
@pesterenan
@pesterenan 6 ай бұрын
Another incredible video! It's really impressive how just by drawing things but with a different 'view' can yield this pseudo 3d effect. Nice one Radu!
@Radu
@Radu 6 ай бұрын
Thank you! Yeah, sometimes few lines of code makes a big difference :-)
@javifontalva7752
@javifontalva7752 6 ай бұрын
It is just unbelievable. As soon as I can I will start doing this project. Looking forward to it!
@Radu
@Radu 6 ай бұрын
Hope you'll like it :-)
@Eternam
@Eternam 6 ай бұрын
marvelous! Thank you very much Radu.
@Radu
@Radu 6 ай бұрын
No problem!
@javifontalva7752
@javifontalva7752 6 ай бұрын
This is mind-blowing!!
@Radu
@Radu 6 ай бұрын
Glad you think so!
@___d3p1
@___d3p1 6 ай бұрын
The way you managed this perspective effect was brilliant!!!!! This was one of my favorite videos just because I think that it was very creative how you resolve all details!
@Radu
@Radu 6 ай бұрын
Glad you enjoyed it! :-)
@christian-schubert
@christian-schubert 6 ай бұрын
When you're being prompted to watch 'Coding with Radu [Extended Intro]', you click and watch 'Coding with Radu [Extended Intro]'. Three times. Christ, I almost forgot to come back here!
@Radu
@Radu 6 ай бұрын
:-))
@backstabba
@backstabba 6 ай бұрын
Impressive work!
@Radu
@Radu 6 ай бұрын
Thanks a lot!
@faruktutkus
@faruktutkus 6 ай бұрын
Very good thanks
@Radu
@Radu 6 ай бұрын
You're welcome!
@zohaibqurban7386
@zohaibqurban7386 6 ай бұрын
amazing
@Radu
@Radu 6 ай бұрын
Thanks!
@TORMENTUMM
@TORMENTUMM 5 ай бұрын
Great!
@Radu
@Radu 5 ай бұрын
Thanks!
@cazpfitl
@cazpfitl 6 ай бұрын
Excellent.
@Radu
@Radu 6 ай бұрын
Thanks!
@cazpfitl
@cazpfitl 6 ай бұрын
@@Radu thanks to you professor, amazing content.
@davidmurphy563
@davidmurphy563 6 ай бұрын
Awesome video, my favourite bit was the brief clip at 0:12 - the person who did it must be very handsome and charming. ;))
@Radu
@Radu 6 ай бұрын
Have to agree with you on that one :-)
@DanielJoseAutodesk
@DanielJoseAutodesk 6 ай бұрын
Look at the new GTA or Driver game being born .... 😂😁🙂👍
@Radu
@Radu 6 ай бұрын
Almost :-)
@harshchoudhary5452
@harshchoudhary5452 4 ай бұрын
I've completed the entire tutorial on Free Code Camp, but I couldn't locate the video that guides on creating 3D building roofs with a consistent height. Where can I find that specific tutorial?
@Radu
@Radu 4 ай бұрын
Hi, it's a special, short video only visible to channel members (those who pay some fee). But you can find my code after that segment on github, so, try to figure out what I did, and if questions, ask here or on Discord :-).
@devperatetechno8151
@devperatetechno8151 6 ай бұрын
Radu, for the next series probably a good idea is to use an approach of module pattern(ES6 import/export) to the utils functions so we can easily identify where the functions came from. enjoying the course, greetings
@Radu
@Radu 6 ай бұрын
I will consider it. I don't like that it requires some (local) server to be setup...
@devperatetechno8151
@devperatetechno8151 6 ай бұрын
@@Radu why,? i think you have misunderstood my idea
@Radu
@Radu 6 ай бұрын
Perhaps... I understood I should use import/export. But I would need a local server for that (like the live server extension in VSCode). Not everyone knows how to do that and I kind of like that people just type using any editor and the browser shows the result... I also like that if I go teach in class (or in other universities), I don't have to worry if there is some specific software installed on the computers.
@devperatetechno8151
@devperatetechno8151 6 ай бұрын
@@Radu im going to text you on discord so we can keep this talk further, is that ok?
@Radu
@Radu 6 ай бұрын
Cool!
@ChandrashekarCN
@ChandrashekarCN 6 ай бұрын
💖💖💖💖
@Radu
@Radu 6 ай бұрын
💖
@aditya2005_found
@aditya2005_found 5 ай бұрын
Have you uploaded the special video you are talking about at 33:14 ? if (yes) { return video_link } else { console.log("I'll wait for it") }
@Radu
@Radu 5 ай бұрын
I did, but it's only for channel members :-)
@aditya2005_found
@aditya2005_found 5 ай бұрын
@@Radu Oh! ok that's fine (❁´◡`❁)
@Radu
@Radu 5 ай бұрын
@@aditya2005_foundyou're not missing anything groundbreaking there. You can check the code changes I did on github to see the difference and if you don't understand something, ask here or on Discord.
@aditya2005_found
@aditya2005_found 5 ай бұрын
@@Radu Yeah! Thanks 😊
@DimaMelom
@DimaMelom 4 ай бұрын
@@Radu, I subscribed to the channel, but I haven’t seen the video, it’s very interesting to repeat the video
@bennybrouwer
@bennybrouwer 6 ай бұрын
Hi Radu, I was expecting lesson 7 but see that your playlist has been reduced to the first three lessons only. Anyway, so far I am following and studying with great pleasure :-)
@Radu
@Radu 6 ай бұрын
Oh, you're right, I forgot to add more videos to the playlist (fixed it now, thanks for pointing it out!). Lesson 7 comes next week, I explained why in a short: kzbin.infozySkg7JlBro
@bennybrouwer
@bennybrouwer 6 ай бұрын
@@RaduTake your time - You have a great competion in Frank's Laboratory .. not AI but the same level of speed in animation, structure (using classes :-)) . Just for fun . . when all my cars are riding over your streets with all their AI knowledge, Frank's whales will be trained to eat them like any Particle... with shining and moving stars in the background. Not so sure if it is wise to do two courses at the same time and try to make one project out of it but my dad started collecting stamps when he reached the age of 60+ ... I've passed 60 and you (both) are making my life fun and challenging.
@Radu
@Radu 6 ай бұрын
You made me very curious in the outcome :-D
@berkantguler75
@berkantguler75 6 ай бұрын
🎉
@Radu
@Radu 6 ай бұрын
💖
@swapnildeshmukh5900
@swapnildeshmukh5900 6 ай бұрын
That's Lee's move 1:03 😂
@Radu
@Radu 6 ай бұрын
You mean 1:25? :-)
@ZerobugCoder
@ZerobugCoder 4 ай бұрын
@Radu How to learn from you in person, as in a degree course
@Radu
@Radu 4 ай бұрын
Well... I do teach here: www.karelia.fi/en/information-and-communication-technology
@javifontalva7752
@javifontalva7752 6 ай бұрын
How do we create the roundabout?
@Radu
@Radu 6 ай бұрын
Just click many times to define a round shape. Or, when I teach how to read data from openstreetmap (in a few weeks) they will be generated automatically.
@user-tx6qb5zh9y
@user-tx6qb5zh9y 6 ай бұрын
Can I add all this projects to my projects portfolio sir
@Radu
@Radu 6 ай бұрын
If you want, but I recommend personalizing them as much as possible... Too many portfolios nowadays look the same :-(
@alexch5106
@alexch5106 6 ай бұрын
Hi, question. Can you do a video o show me some code. I am trying to do consecutive lines with different length and angles. The problem is later when I finish and change angle, the next lines are not updating angle to pre defined angles. I am trying to code something like this kzbin.info/www/bejne/oHaveoKBhrR-qNk Thank you
@Radu
@Radu 6 ай бұрын
Interesting feature. I haven't implemented anything like this yet, but I'm quite sure that you need to implement the concept of a 'group' which will need an 'anchor point': the point relative to which the rest of the shape will rotate (for example). Hope this helps!
@alexch5106
@alexch5106 4 ай бұрын
@@Radu I tried but my problem is after update angle of a line it does not update the following lines to the angle + the correction angle for prior line when I re-draw it.
@karthikm.1804
@karthikm.1804 6 ай бұрын
How to create a chess AI with javascript
@Radu
@Radu 6 ай бұрын
Maybe I teach it someday, but at the moment I don't know much about the topic (apart for the textbook minimax algorithm typically used for the task)
@pizdaxyu
@pizdaxyu 6 ай бұрын
amazing.. my dull brain would never figure out how to come up with sorting so that depending on angle some stuff is visible while other is not. I'd just format c: my computer in frustration
@Radu
@Radu 6 ай бұрын
I'm sure you would :-) Also... it's not a perfect solution. There are situations when it fails, but they happen rarely with our parameters so result looks pretty good.
@javifontalva7752
@javifontalva7752 5 ай бұрын
Math.cos(((a + this.center.x) * size ) % 17) ** 2 Where did you get this from?? 😱
@Radu
@Radu 5 ай бұрын
Somewhere deep inside my head :-D
Distance from Point to Segment Explained using JavaScript
25:11
Radu Mariescu-Istodor
Рет қаралды 4,5 М.
одни дома // EVA mash @TweetvilleCartoon
01:00
EVA mash
Рет қаралды 6 МЛН
I Built an Interactive AI Talking Avatar
7:51
Rob Enriquez
Рет қаралды 3,1 М.
NEW GPT-4o: My Mind is Blown.
6:28
Joshua Chang
Рет қаралды 447 М.
A Virtual World - JavaScript Course: Lesson 10 / 11 [OpenStreetMap Tutorial]
43:48
Self-driving car - No libraries - JavaScript course [Lecture 5]
13:06
Radu Mariescu-Istodor
Рет қаралды 7 М.
Self-driving car - No libraries - JavaScript course [Lecture 8]
28:44
Radu Mariescu-Istodor
Рет қаралды 10 М.
How You Can Easily Make Your Code Simpler in Godot 4
6:59
Bitlytic
Рет қаралды 327 М.
одни дома // EVA mash @TweetvilleCartoon
01:00
EVA mash
Рет қаралды 6 МЛН