Coding Challenge

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ค. 2024
  • In this video, I implement a basic ray casting engine with line segment “surfaces” and vector “rays.” The result simulates a light source casting shadows in a 2D canvas. thecodingtrain.com/challenges...
    🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
    🎥 Next video: • Coding Challenge #146:...
    🎥 All videos: • Coding Challenges
    References:
    🌞 SIGHT & LIGHT by Nicky Case: ncase.me/sight-and-light/
    🌞 2d Visibility from Red Blob Games: www.redblobgames.com/articles...
    💾 p5.collide2D: github.com/bmoren/p5.collide2D
    🗄 Line-line Intersection: en.wikipedia.org/wiki/Line%E2...
    Videos:
    🎥 Coding Adventure: Ray Marching: • Coding Adventure: Ray ...
    🎥 Matrix Math: • 10.6: Neural Networks:...
    🎥 Coding Challenge: Rendering Ray Casting: • Coding Challenge #146:...
    🔴 Coding Train Live 177: • Coding Train Live 177:...
    Timestamps:
    0:00:00 Introduction
    0:03:34 Coding Starts
    0:05:54 Creating a Ray Class
    0:09:16 Casting Rays And Finding Intersections
    0:19:56 Casting Multiple Rays
    0:24:41 Adding Collision Detection For Every Ray
    0:26:47 Multiple Boundaries
    0:31:23 Moving With Perlin Noise
    0:32:41 Suggestions For Improvements
    Editing by Mathieu Blanchette
    Animations by Jason Heglund
    Music from Epidemic Sound
    🚂 Website: thecodingtrain.com/
    👾 Share Your Creation! thecodingtrain.com/guides/pas...
    🚩 Suggest Topics: github.com/CodingTrain/Sugges...
    💡 GitHub: github.com/CodingTrain
    💬 Discord: / discord
    💖 Membership: th-cam.com/users/thecodingtrainjoin
    🛒 Store: standard.tv/codingtrain
    📚 Books: www.amazon.com/shop/thecoding...
    🖋️ Twitter: / thecodingtrain
    📸 Instagram: / the.coding.train
    🎥 Coding Challenges: • Coding Challenges
    🎥 Intro to Programming: • Start learning here!
    🔗 p5.js: p5js.org
    🔗 p5.js Web Editor: editor.p5js.org/
    🔗 Processing: processing.org
    📄 Code of Conduct: github.com/CodingTrain/Code-o...
    This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...

ความคิดเห็น • 518

  • @atrumluminarium
    @atrumluminarium 5 ปีที่แล้ว +1084

    Omg this video is so coherent and organised unlike the live stream. Your editor needs a raise Dan hahah

    • @MattRose30000
      @MattRose30000 5 ปีที่แล้ว +35

      That's why I always wait for the edited versions, they are just so much nicer to watch.

    • @taba1950
      @taba1950 5 ปีที่แล้ว +81

      @@MattRose30000 while true the live stream still have a unique entertaining value

    • @LuisHansenNH
      @LuisHansenNH 4 ปีที่แล้ว +39

      Showing your code VS coding live. That's why I hate coding interviews. It's like they say: the worst part of parallel parking are the witnesses.

    • @vintyprod
      @vintyprod 4 ปีที่แล้ว +8

      @@taba1950 while(true)

    • @MizhiBirb
      @MizhiBirb 3 ปีที่แล้ว +7

      more like a RAYS

  • @MSecYT
    @MSecYT 4 ปีที่แล้ว +177

    6:59 "I didn't forget this time"... immediately forgets to add this to the dir.x, and dir.y

  • @discreet_boson
    @discreet_boson 3 ปีที่แล้ว +134

    This man is an international treasure and should be protected at all costs

  • @cassioschneider922
    @cassioschneider922 5 ปีที่แล้ว +83

    i've never coded anything. don't know why i watched the entire video.
    still, this is AWESOME
    thanks! cheers

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +14

      You can start learning here! th-cam.com/play/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA.html

    • @cassioschneider922
      @cassioschneider922 5 ปีที่แล้ว +5

      @@TheCodingTrain Thanks for replying! i'll definitely try it out :D

    • @cassioschneider922
      @cassioschneider922 4 ปีที่แล้ว +37

      @@nerasure actually I watched the entire playlist with the starting tutorials! I made some really cool stuff, made 3d pong, moon phases shown in 3d, a few simple games and other simple stuff just to try out p5js and learn a little
      I would definitely recommend it, Daniel is an awesome teacher, always so positive and ready to a swerve questions!

    • @kenan2386
      @kenan2386 3 ปีที่แล้ว +2

      :)

  • @dkkoala1
    @dkkoala1 5 ปีที่แล้ว +134

    The ray.cast method is already calculating the relative distance to each intersecting object in the form of "u", so an optimization would be to use it instead of the p5.vector.dist function. This is more efficient because p5.vector.dist uses euclidean distance, and therefore calculates square roots each time it is called, which is a heavy calculation.
    But great video as always!

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +22

      Thanks for the feedback!

    • @dkkoala1
      @dkkoala1 5 ปีที่แล้ว +14

      ​@@TheCodingTrain No problem, i always love your videos because they remind me that coding can still be beautiful. Im a machine learning master student, so your project with the self driving car interests me very much, even though i am more of a supervised learning guy. Please feel free to contact me if you need some resources for how to approach the subject. In any case you should definitely check out Arthur Juliani's Medium article about Q-learning, it is a very good resource to reinforcement learning.

    • @likeyou3317
      @likeyou3317 5 ปีที่แล้ว +2

      So smaller "u" means dist is smaller?

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +11

      @@dkkoala1 Indeed, such a great reference!

    • @dkkoala1
      @dkkoala1 5 ปีที่แล้ว +5

      @@TheCodingTrain Another thing that could maybe speed up your training is the concept of curriculum learning. It is done by starting out training with the simplest version of your problem and then as the AI gets better raise the difficulty of your training. An example could be starting with training the AI to drive in a straight line, and when it can do that then add a bend to the track. Multiple objective functions could also be useful, first prioritizing getting to the end of the by having the distance to the goal as your loss, and afterwards using the speed at which the AI can get there instead. In this way you first ensure a basic understanding of the task and then you can optimize it make the model better and faster at the task. Unity has a great blog for curriculum learning blogs.unity3d.com/2017/12/08/introducing-ml-agents-v0-2-curriculum-learning-new-environments-and-more/

  • @justiceforsethrichwwg1wga160
    @justiceforsethrichwwg1wga160 5 ปีที่แล้ว +53

    I’ve been watching your channel for awhile now....you’ve gotten way better at your presenting! Really great content! Easily one of my favorite channels.

  • @nehoymenoy3845
    @nehoymenoy3845 4 ปีที่แล้ว +28

    It's awesome when a feature can be implemented for both visual and functional purposes.

  • @rolandferguson1209
    @rolandferguson1209 ปีที่แล้ว +1

    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

  • @TheFlamingWaldo
    @TheFlamingWaldo 3 ปีที่แล้ว +19

    I program in Python -- I used C++ back when I was in college, but it didn't sit well with me -- and I was inspired by this to try to program some raycasting *in* python, despite my limited experience with trigonometry. I tried my best to construct as many of the math-related functions as I could from scratch, which means I made my own function for finding magnitude, normalizing lines, for projecting lines out at a specific angle, etc etc. I was worried it was going to run awful, but it's actually pretty smooth! It was difficult for me, as I've never taken a trigonometry course and I actually managed to fail remedial math once, but something about wanting to accomplish something makes me learn more. I feel really happy with myself, even if I have what would probably have been easier if I had just used built-in library functions to do my work for me. Your work always inspires me, and this is the third project I've made based off of the suggestions in your videos, so thank you so much!

    • @matiascollado9926
      @matiascollado9926 ปีที่แล้ว

      How did you make the ray extend to infinity in one direction?

    • @adammoore4359
      @adammoore4359 ปีที่แล้ว

      @@matiascollado9926 did you figure this out?

    • @matiascollado9926
      @matiascollado9926 ปีที่แล้ว

      @@adammoore4359 I did not extend it to infinity, rather I extended it far enough that the user never sees the end of the rays

  • @god_i_hate_google5142
    @god_i_hate_google5142 5 ปีที่แล้ว +4

    I never have time to watch all your videos but in every video ive watched you seem to be enjoying your self and I am honestly jealous that you enjoy coding this much

  • @HellTriX
    @HellTriX 5 ปีที่แล้ว +10

    The end result to this one was absolutely beautiful. I think its my favorite one yet. I also cannot wait to see some NNs applied to this!

  • @izangomez6806
    @izangomez6806 5 ปีที่แล้ว +194

    3:25 Code bullet will help you, sure

  • @batonator
    @batonator 5 ปีที่แล้ว +19

    i love your enthusiasm, you make me wanna code more. I can't wait to get a PC

  • @yourteacher4353
    @yourteacher4353 5 ปีที่แล้ว +6

    So basically there are two kinds of people: 1) people and 2) people who brighten your day up. You Daniel is the king of kind 2.

  • @soejrd24978
    @soejrd24978 5 ปีที่แล้ว +2

    That plan on this project is insane!! I"m so hyped!!

  • @DenerWitt
    @DenerWitt 5 ปีที่แล้ว +6

    I like the light like effect at the end. when math and programming become art. Pretty.

  • @NinjarioPicmin
    @NinjarioPicmin 5 ปีที่แล้ว +2

    Yay for Nicky Case. I love a lot of their work

  • @7cle
    @7cle 5 ปีที่แล้ว +2

    Keeping this that simple, given the complexity of the subject is the mark of a rare gift Dan : intelligence! Thank you for sharing it with us. It is a pity so many are not fussed to share stupidity on social media though.

  • @wlockuz4467
    @wlockuz4467 ปีที่แล้ว +1

    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!

  • @thegoodhen
    @thegoodhen 4 ปีที่แล้ว +8

    This really reminds me of SLAM (simultaneous localization and mapping) visualizations in robotics. You have a robot with a LIDAR scanner and it sees the environment in exactly this way, as it casts multiple laser rays.

  • @ValleyOfWillows
    @ValleyOfWillows 3 ปีที่แล้ว +19

    Making the boundaries into letters with the same color as the background and then having the lightsource just randomly go around the canvas would probably make a cool screensaver.

    • @zelioz848
      @zelioz848 7 หลายเดือนก่อน +2

      Yo that is sick, i'm gonna learn how to change my desktop background to something like that and program it myself

  • @Couchwurst
    @Couchwurst 4 ปีที่แล้ว

    Thank you for this awesome Coding Challenge! And for bringing up the reference to Nicky Case - his game and ideas are fantastic!

  • @squirrel1620
    @squirrel1620 5 ปีที่แล้ว +6

    When I was coding with unreal 2 and 3 engine, the Trace and FastTrace were used for ray tracing. It worked more or less the same, mathematics wise anyways. They pull more tricks to avoid multiplication or division because it saves time.

  • @ivankorytko1964
    @ivankorytko1964 5 ปีที่แล้ว

    The best explanation of the work. Interesting, understandable, not boring and I was impressed that it is easy. I do not know JS, but the idea and logic is quit simple. Thanks for your videos.

  • @cidie1
    @cidie1 2 ปีที่แล้ว

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

  • @_jonathancollins
    @_jonathancollins 3 ปีที่แล้ว

    This is the first time I've watched your videos, and frankly, I'm a bit disturbed by how excited you are.
    It's contagious...

  • @shaileshrana7165
    @shaileshrana7165 3 ปีที่แล้ว +5

    Light also diffuses around edges. Maybe that can be added.

  • @elliotressler4201
    @elliotressler4201 5 ปีที่แล้ว +4

    Your enthusiasm got me excited as well. I'm sure it was worth a sub (:

  • @HoneyDustTheReal
    @HoneyDustTheReal 2 ปีที่แล้ว +6

    i'm just putting my idea here but i think it would be really cool and entertaining to combine the maze generator algorithm with the a* pathfinding algorithm to solve it and finally this one that could be implemented by redirecting the "light source" to the mouse cursor and be able to explore the maze (which would be all dark at first) and just seeing the light making it's way to the edges of the paths as we move along them, like some sort of dark exploration game

    • @Mabeloid
      @Mabeloid ปีที่แล้ว +1

      sounds like 2d scanner sombre

  • @MagnaKay
    @MagnaKay 3 ปีที่แล้ว

    The enthusiasm is so contagious ahah. Good job!

  • @therealstillie
    @therealstillie 4 ปีที่แล้ว

    That was unbelievably enjoyable to watch!!!! Thank you

  • @thebrickccentric3728
    @thebrickccentric3728 หลายเดือนก่อน

    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

  • @catherinebernard3282
    @catherinebernard3282 4 ปีที่แล้ว +1

    Thanks to this I managed to get a version of this working in gamemaker (studio 2). Was a lot of fun.

  • @CYXNIGHT
    @CYXNIGHT 5 ปีที่แล้ว +6

    I used to code on Gamemaker, and was transitioning to Unity, but I came across your channel and Java is now my favourite language. I was getting discouraged from coding as Gamemaker couldn't do what I wanted, but since your channel popped up in my recommended I have sinced been coding almost every day as I never cease to find something to code, I can't thank you enough.
    I love your channel and your vibrance, I hope you never stop these videos, and live-streams!

    • @33KK
      @33KK 5 ปีที่แล้ว

      He uses JavaScript

    • @TheCodingTrain
      @TheCodingTrain  5 ปีที่แล้ว +1

      Thanks for this nice feedback!

  • @julianirmer5854
    @julianirmer5854 5 ปีที่แล้ว +7

    The only channel for which I activated notifications.

  • @sushicook816
    @sushicook816 4 ปีที่แล้ว

    This channel is a gold mine for researchers.

  • @massimogiardina9138
    @massimogiardina9138 5 ปีที่แล้ว +1

    You helped me so much with this.
    How could I ever thank you?

  • @sonik382
    @sonik382 5 ปีที่แล้ว +1

    I am trying to code the AI car as well...awesome you suggested that! Can't wait for the next challenge! Greetings from Italy!

  • @mihaisolomon2893
    @mihaisolomon2893 5 ปีที่แล้ว +10

    I did something like this 1 month ago, but my code wasn't so explicit, thank you for the explanation

  • @dalegriffiths3628
    @dalegriffiths3628 4 ปีที่แล้ว

    Fantastic - can't wait for the self driving vehicle you mentioned you'd like to do with this!

  • @Apoorvpandey
    @Apoorvpandey 5 ปีที่แล้ว +92

    Coding train : "
    Making world a better place to live in "🌼🌼🌼

  •  4 ปีที่แล้ว +1

    I've been a subscriber for a while but I'm not used to watch a full video.
    That one caught me and I was able to follow easily your train of thought even tho I don't know those libraries.
    Amazing work. Programming should be exciting as you are showing!

  • @proxy1035
    @proxy1035 4 ปีที่แล้ว +52

    2:34 when your parents ask you to do anything

    • @masonhunter2748
      @masonhunter2748 3 ปีที่แล้ว +2

      I would give a like but it’d overflow

  • @FazpyDev
    @FazpyDev 2 ปีที่แล้ว

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

  • @Briggoes
    @Briggoes 5 ปีที่แล้ว

    always wanted to learn this! thanks!

  • @Edd4324
    @Edd4324 ปีที่แล้ว

    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!

  • @itoverview-awesomeandroida1492
    @itoverview-awesomeandroida1492 4 ปีที่แล้ว

    Congrats on 1 million! :)

  • @scatheroy
    @scatheroy 4 ปีที่แล้ว

    Just awesome. Great video. Thanks, man.

  • @notgate2624
    @notgate2624 5 ปีที่แล้ว

    I would love a video on ray tracing! Great video!

  • @garychap8384
    @garychap8384 4 ปีที่แล้ว

    More efficiently, when trying to identify the whole area "visible" from a point ...
    For all obstacle endpoints, take their angle. Sorting the endpoints by these angles gives you a clockwise (or anticlockwise) list of points. Now it's easy to evaluate each point in turn, working around the circle to construct a convex region of points. You can then gradient fill that region, or use the region to apply dynamic lighting/shadows.
    You can even do some fairly complex stuff with this region/origin ... particularly if your 2D tiles have an extra map for a simplified 'normal' and 'height'. The height lets you suspend lighting (for some distance) along the ray, giving you tiles that cast shadows onto tiles, to cast composite shadows on floors. Orientation and Slope values per pixel let you modulate how a dynamic light affects the base texture.
    But, at its very simplest, you can just use a very weak alpha with a circular gradient to give a very subtle effect which, although it's not accurate, is subtle enough that people don't notice.
    You can have lots of fun with these regions.

  • @andrewweller5119
    @andrewweller5119 8 หลายเดือนก่อน

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

  • @DodaGarcia
    @DodaGarcia ปีที่แล้ว

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

  • @MrNosugarcoating
    @MrNosugarcoating 5 ปีที่แล้ว

    Wow that looks so cool

  • @photoelectron
    @photoelectron 5 ปีที่แล้ว

    thanks for sharing, that was pretty neat !

  • @run4thewin357
    @run4thewin357 4 ปีที่แล้ว

    This is the most interesting video i saw this year

  • @itay1213141
    @itay1213141 5 ปีที่แล้ว +1

    Great video, i love these so much 😁

  • @medhavimonish41
    @medhavimonish41 4 ปีที่แล้ว

    wow , you never fail to amaze

  • @RhoTrepaan
    @RhoTrepaan 4 ปีที่แล้ว

    it looks very pretty! :D
    (and very informative, too)

  • @t.m.h1721
    @t.m.h1721 5 ปีที่แล้ว

    Your video inspires me a lot

  • @alexmattheis
    @alexmattheis 3 ปีที่แล้ว

    Very good explanation and coding.

  • @reggy698
    @reggy698 5 ปีที่แล้ว

    Love your video style. Going to have a play with this tonight see if I can make 2 rays interact with gravity and merge say red and blue to make a purple singularity that then bursts with gamma

  • @Jeff-Vader_head_of_catering
    @Jeff-Vader_head_of_catering 5 ปีที่แล้ว

    Very cool! My brain melted about 1/4 of the way into the video, but, cool.

  • @WzzupDaAwsome
    @WzzupDaAwsome 5 ปีที่แล้ว +3

    What if you made the light that hits the walls reflect back at whatever angle it hit the wall? I've seen videos of rooms where there is a single point where light can't reflect to, it would be cool to test that out with this program.

  • @abazur7742
    @abazur7742 5 ปีที่แล้ว

    now after this video i can tell that you are a genius

  • @bluepixelmusic9463
    @bluepixelmusic9463 5 ปีที่แล้ว +2

    finally a channel that doesnt expect me to be a master brain

  • @husseinshukre3828
    @husseinshukre3828 2 ปีที่แล้ว

    Great video helped me build openGl program that recolor the selected polygon

  • @Damian_Stefann
    @Damian_Stefann 5 ปีที่แล้ว +1

    Dude i am making videogame and i needed this! Thanks :)

  • @Xeronimo74
    @Xeronimo74 5 ปีที่แล้ว

    awesome tutorial!

  • @Csc5csc5
    @Csc5csc5 4 ปีที่แล้ว +19

    Bruh, that's a lot of energy before noon. Coffee or Red Bull?

  • @Bunnybobscodes
    @Bunnybobscodes ปีที่แล้ว

    Great video!

  • @elendil4543
    @elendil4543 2 ปีที่แล้ว

    This guy can make whole game engine with processing

  • @matteobarbieri2989
    @matteobarbieri2989 5 ปีที่แล้ว

    this is awesome!

  • @yhjeong5317
    @yhjeong5317 5 ปีที่แล้ว

    Wow.... I really like this.. thank you!!

  • @a.osethkin55
    @a.osethkin55 2 ปีที่แล้ว

    Amazing!

  • @RedMasterJV
    @RedMasterJV 20 วันที่ผ่านมา

    LMAO that "this dot" tune is great

  • @nicolasmarques7460
    @nicolasmarques7460 4 ปีที่แล้ว

    Amazing thanks for share this content!

  • @omaislindodesantos
    @omaislindodesantos 10 หลายเดือนก่อน

    great video really thank for doing it.

  • @mr.budders8740
    @mr.budders8740 3 ปีที่แล้ว

    My man, I want to give you the highest honor I can bestow for teaching me in 20 minutes (only the first portion of video) how to detect ray intersection when everywere else says that you gotta to a bunch of tan() cos() and sin() functions with some more advanced trigonometry within and hour. A subscribe
    BTW I litterally spent 4+ hours trying the other method and it never worked

    • @homelikebrick42
      @homelikebrick42 2 ปีที่แล้ว

      BTW that is actually what p5 is doing for you inside p5.Vector

  • @Donahue9389
    @Donahue9389 4 ปีที่แล้ว

    I'm a p5 newbie, and I am curious how you are using createVector outside of the setup function. Are you in "on demand global mode"?

  • @8bit_pineapple
    @8bit_pineapple 4 ปีที่แล้ว +13

    ♫When A Grid's
    Misaligned With
    Another Behind
    That's a Moiré♫

    • @masonhunter2748
      @masonhunter2748 3 ปีที่แล้ว

      You stole it

    • @8bit_pineapple
      @8bit_pineapple 3 ปีที่แล้ว

      @@masonhunter2748 Yea. Credits to xkcd comics, that everyone here should read ;)

    • @masonhunter2748
      @masonhunter2748 3 ปีที่แล้ว

      8bitpineapple what’s the number

    • @-Burb
      @-Burb 3 ปีที่แล้ว

      @@masonhunter2748 1814

  • @TSPxEclipse
    @TSPxEclipse 4 ปีที่แล้ว +2

    Personally I would have loved for there to be a segment added into the code for reflection/refraction, but with a simple ray vs. boundary setup on a 2D plane that would have been complete overkill.

  • @SarcTiann
    @SarcTiann 10 หลายเดือนก่อน

    Super Awesome!

  • @bovineox1111
    @bovineox1111 2 ปีที่แล้ว

    I've been doing this with a vertex shader that projects the shadow volume into the distance generating a render texture. This method uses the whole GPU but consumes all of the objects within the orthographic view of a top down camera. Boundaries are cheap mind (rarely more than 8 triangles per boundary) but I then have to multiple the resulting shader fragment by a pick from this shadow render target. I wonder if hand crafting just the nearest shadow volumes is faster.

  • @philtoa334
    @philtoa334 3 ปีที่แล้ว

    beautiful .

  • @frankie_goestohollywood
    @frankie_goestohollywood 2 ปีที่แล้ว

    Brilliant video!!!! Thank you :-)

  • @ViciousVinnyD
    @ViciousVinnyD หลายเดือนก่อน

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

  • @anotherdimension97
    @anotherdimension97 4 ปีที่แล้ว

    Grandioso, saludos desde Perú.

  • @johnydl
    @johnydl 5 ปีที่แล้ว

    hmmm Just a thought how would you go about making the look(walls) do async things.
    Each Ray could be done at the same time, and within each ray, each wall could be done at the same time, but I'm not sure how to turn a for each into a promise all statement. Getting all the wall promises back with their minimum distances and doing a Math.min on the whole lot together gets you the ray's magnitude, and since none of the rays interact they can all be treated in parallel.

  • @2skateboards113
    @2skateboards113 3 ปีที่แล้ว

    this video is awesome thanks for this :)

  • @imvickykumar999
    @imvickykumar999 4 ปีที่แล้ว +1

    You are my inspiration 🤘🤘

  • @artistpw
    @artistpw 2 ปีที่แล้ว

    This would make a great night light on a screen.

  • @jonmichaelgalindo
    @jonmichaelgalindo 4 ปีที่แล้ว

    I just tried doing this last week, and I also arbitrarily picked cast(). :-)
    Although I first intersected the ray with a polygon's bounding-box (polygons had translation/rotation/scale), then transformed the ray into the polygon's local space, then calculated the intersect depth (if any), then transformed that depth back out to the ray's space. That way I didn't have to convert all the polygons' vertices to global space, since I only need the ray's collision point for drawing.

    • @jonmichaelgalindo
      @jonmichaelgalindo 4 ปีที่แล้ว

      Also, it looks like you're using p5 for vector stuff, but I was just using JS.

  • @My-video123
    @My-video123 3 ปีที่แล้ว +1

    At first I thought you are very strange guy. After several your videos I just realized it’s a gold material to be taught and implemented. Thank you mate

  • @OrangeC7
    @OrangeC7 5 ปีที่แล้ว +7

    You should check out CodeParade's videos on ray marching as well. There are a lot of cool things you can do with the technique! :D

  • @alfcnz
    @alfcnz 2 ปีที่แล้ว

    Impressive! 🤯🤯🤯

  • @mehmetedex
    @mehmetedex 4 ปีที่แล้ว

    This is so cool.

  • @krccmsitp2884
    @krccmsitp2884 ปีที่แล้ว

    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?".

  • @janne_kekalainen
    @janne_kekalainen 4 ปีที่แล้ว

    Really cool, also I have spent about 6 hours recreating this in WPF C# It isn't the best and a resource hog, but it does mostly the same thing.

  • @toxicwaste8182
    @toxicwaste8182 3 ปีที่แล้ว

    Coding a line would send me off the wall. Then here you are making ray casts

  • @defforadio6428
    @defforadio6428 5 ปีที่แล้ว

    wow! just wow!