Coding Challenge 145: 2D Raycasting

Coding Challenge 145: 2D Raycasting

The Coding Train

5 лет назад

643,163 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@OrangeDied
@OrangeDied - 30.12.2021 04:33

The funny thing about this guy is he sounds like me after doing something for 4 hours talking to myself, like "So now I have to do this, and it should... do the thing"

Ответить
@core36
@core36 - 28.01.2022 09:53

i always come back here when i ned line->line intersections

Ответить
@cidie1
@cidie1 - 02.02.2022 02:17

Thanks so much, I'm half watching for the subject and half watching because you are just so fun!

Ответить
@badunius_code
@badunius_code - 07.02.2022 16:02

One thing drives me mad throughout those series. A line is drawn between two points; the center of a circle is a point, and distance is measured between two points...
And p5 has a structure to represent a point, a Vector
But no. No no no no no! We are going to use coordinates for an argument of those functions

Ответить
@yasintonge823
@yasintonge823 - 01.03.2022 13:33

this dot son.

Ответить
@sayantanghosh9576
@sayantanghosh9576 - 01.03.2022 14:57

Where is self driving carr

Ответить
@FazpyDev
@FazpyDev - 05.03.2022 15:28

This video is so useful, I'll for sure have a look at it!

Ответить
@shoxdanger
@shoxdanger - 06.03.2022 13:44

can you do a minecraft plugin tutorial ? thats a Coding Challenge for you

Ответить
@KDSBestGameDev
@KDSBestGameDev - 08.03.2022 02:32

t basically is where on the line is the hit. 0 means it is on point a, 1 means it is on point b. Higher than 1 means beyond point b and lower than 0 before point a. That also means t > 0 should be t >= 0 and t < 1 should be t <= 1.

Ответить
@lucasgabriel3903
@lucasgabriel3903 - 08.03.2022 12:39

Mesmo sem entender inglês esse vídeo é como se tudo comunicado conquista como apreendido.

Ответить
@khatharrmalkavian3306
@khatharrmalkavian3306 - 09.03.2022 02:23

Why are you laughing?

Ответить
@raihaan1819
@raihaan1819 - 11.03.2022 13:08

Cool thumbnail

Ответить
@elendil4543
@elendil4543 - 13.03.2022 15:40

This guy can make whole game engine with processing

Ответить
@geraforever796
@geraforever796 - 14.03.2022 04:07

This is actually raytracing.

Ответить
@knz5673
@knz5673 - 14.03.2022 20:44

Rule 34* if it exists, there is a "the coding train" video of it.

Ответить
@TheGreatArlei
@TheGreatArlei - 15.03.2022 13:12

Okay but how do you run your code after you have written it? like...visually. How do you open that window in your browser?

Ответить
@danielesquivel3155
@danielesquivel3155 - 27.03.2022 22:29

me entanca :3

Ответить
@basicallybrand
@basicallybrand - 25.04.2022 13:48

I am having a hard time implementing this with rectangle instead of lines

Ответить
@koomkvat5792
@koomkvat5792 - 06.06.2022 15:48

where 3d?

Ответить
@moradshihdeh5903
@moradshihdeh5903 - 13.06.2022 17:09

2022 the formula for u changed u = ((x1 - x3) * (y1 - y2) - (y1 - y3) * (x1 - x2)) /denominator, I was scratching my head when i saw that, at some point had an error and tried to fix it from the wiki. I made a mess until realize that they are two different formulas, dont know why they change it. they seem to give the same result.

Ответить
@rolandferguson1209
@rolandferguson1209 - 27.06.2022 18:45

I haven't been programming in a while and jumping back in to your tutorials I get to see how much comedy you've added! it's great to see you so expressive

Ответить
@toastyPredicament
@toastyPredicament - 12.08.2022 15:08

Dreams are lies only coffee is true

Ответить
@toastyPredicament
@toastyPredicament - 12.08.2022 15:09

Because I hate them and they retaliated

Ответить
@JohnPaulBuce
@JohnPaulBuce - 11.09.2022 19:22

i neee more brain power to comprehend this

Ответить
@krccmsitp2884
@krccmsitp2884 - 18.09.2022 21:35

I really like your step-by-step explanations and approach to solving problems. What looked too complicated at first becomes gradually more comprehensible, and finally you think to yourself, "what, it's that simple?".

Ответить
@fahadthenoob4978
@fahadthenoob4978 - 21.09.2022 16:22

damn like among us's shadows

Ответить
@matiascollado9926
@matiascollado9926 - 07.10.2022 20:19

why is this.dir enough for the ray to extend to infinity? Is it something special in java? Because if I draw a vector in python, it only extends as far as its endpoint. Then I can't do the operations

Ответить
@zhabiboss
@zhabiboss - 05.11.2022 14:55

“Now I didn’t forget the this.!” also starts typing dir without this.

Ответить
@DodaGarcia
@DodaGarcia - 26.11.2022 20:06

That ending made me SO happy I can't even describe it

Ответить
@dhaneshabhipraya
@dhaneshabhipraya - 28.11.2022 15:42

Ray-line intersection

Ответить
@SheepUndefined
@SheepUndefined - 18.12.2022 16:12

If the ray is going off in both directions to infinity, doesn't that technically just make it a line? Rays have an origin.

Ответить
@ruidodevinilo
@ruidodevinilo - 05.01.2023 02:18

Sus

Ответить
@GamerX-2000
@GamerX-2000 - 27.01.2023 07:35

I spent way too long trying to trouble shoot this problem: the wiki actually changed the formula for calculating u. it is no longer negative, and there are different value used in the formula. Make sure to either follow EXACTLY what the coding train put for u, or follow EXACTLY what the wiki put for u!

Ответить
@Edd4324
@Edd4324 - 15.02.2023 15:52

I love your sticker on your laptop says never forget the this dot and you forgot it in the first part of the code! Great Video as usual!

Ответить
@Bunnybobscodes
@Bunnybobscodes - 25.04.2023 17:59

Great video!

Ответить
@wlockuz4467
@wlockuz4467 - 30.04.2023 16:15

This video is simply amazing! I always used to think of Raycasting as this very complicated topic which requires a good understanding of Math but at not point did it feel like I didn't understand this video. I am blown away!

Ответить
@omaislindodesantos
@omaislindodesantos - 26.07.2023 01:56

great video really thank for doing it.

Ответить
@SarcTiann
@SarcTiann - 28.07.2023 15:38

Super Awesome!

Ответить
@andrewweller5119
@andrewweller5119 - 21.09.2023 15:13

Great, thanks fo rthis. i re wrote it all to work in Game Maker Studio and have learned soo much.

Ответить
@ihavemanners
@ihavemanners - 15.01.2024 02:53

Is this raycasting or ray tracing?

Ответить
@kakesuofficial
@kakesuofficial - 01.02.2024 17:13

i tried same code on processing 4 and i catch an error syntax on parameter method declaration near 'x1, '

Ответить
@supacagifagilisticexpialid4305
@supacagifagilisticexpialid4305 - 29.02.2024 06:52

I made this same thing in scratch as a 8 year old 5 years ago

Ответить
@thebrickccentric3728
@thebrickccentric3728 - 07.04.2024 06:38

2 cases that the line segment intersection check here forgets to consider (which become more apparent in the next video):

-If the ray is parallel with the wall, but also directly in line with it, the intersection check here will return empty when it should return the closer of the 2 endpoints of the wall (and the distance to it)
-If the particle/vehicle is sitting directly on a wall (or if a wall has the same start and endpoint / 0 length), then the intersection check should return the ray's origin point (0 distance) no matter what

Great video though; this stuff is super useful

Ответить
@ViciousVinnyD
@ViciousVinnyD - 11.04.2024 17:54

Every time this thumbnail shows up in my recommended it does this thing where it moves as I scroll

Ответить
@RedMasterJV
@RedMasterJV - 10.05.2024 04:42

LMAO that "this dot" tune is great

Ответить
@nkheart4
@nkheart4 - 12.06.2024 21:09

My first goal is to learn what you teach, but I also enjoy seeing your reactions when you start coding. I see myself in you, so I love your channel because I feel the same joy you get when coding graphics like this.

Ответить
@brianbrooks4448
@brianbrooks4448 - 07.07.2024 22:40

Very interesting subject matter. Love the quirky presentation style. Sub added. I'm interested in using this type of algorithm, but converted to an electronic system using ultrasonic emitters and sensors. This video was good inspiration though, so thanks for that.

Ответить
@maksymgodovanets1842
@maksymgodovanets1842 - 22.10.2024 18:42

Verry nice video!! THX

Ответить