Let’s build a Raycaster from scratch using Python

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025
  • НаукаНаука

Комментарии • 21

  • @pythonista_333
    @pythonista_333  4 месяца назад +2

    I actually did a mistake on saying that Doom was a raycaster! Doom used a different technique called Binary-Space-Partitioning.

  • @anubhavmondal840
    @anubhavmondal840 4 месяца назад +2

    This is the video I was searching for

  • @sudsy716
    @sudsy716 Месяц назад

    This was the perfect tutorial for me. Instant sub

  • @guilhermecampos8313
    @guilhermecampos8313 5 месяцев назад

    Thanks man, you explanation is very good.

  • @mokouu
    @mokouu 6 месяцев назад +3

    1:04:14 This formula can be confusing if you're truly unfamiliar with how computer graphics work. In computer graphics, y increases downwards, so the opposite side is py - ay, not ay - py. If that's the case, why does the formula still work? Why isn't py - ay correct? It's because our y is flipped. Imagine you're looking up-right: tan(a) is negative (angles increase clockwise in graphics), and py - ay is positive. Positive over negative is negative, so instead of going right, we go left. The simple solution? Just multiply by -1, and suddenly ay - py works. Or, you could calculate tan(360° - a) to get the nice counterclockwise increment that's so popular in math books.

    • @pythonista_333
      @pythonista_333  6 месяцев назад +3

      You're absolutely right, I actually made a mistake there. The proper way of showing that was if I flipped the image vertically. The ray would be facing bottom right, and Ay - Py would be right. imgur.com/a/48vshnV

  • @mansulol5458
    @mansulol5458 6 месяцев назад +1

    Great video bro, i wish i were as good at python as u, i started learning python a week ago and this is way toooooooo impresive, new follow ❤

    • @pythonista_333
      @pythonista_333  6 месяцев назад +1

      Nice to hear that, man! Keep learning and you will achieve even more impressive stuff :D

  • @alokraj4619
    @alokraj4619 6 месяцев назад

    very informative and easy to digest
    thank you

  • @OutOfNet
    @OutOfNet 5 месяцев назад

    great video, i honestly really liked it
    edit in case you read the comment from a notification : i just realised a few seconds later why what i'm saying is dumb, flooring a number that's whole no matter what isn't the smartest thing to do

    • @pythonista_333
      @pythonista_333  5 месяцев назад

      No problem man, i'm glad you liked it!

  • @ohimdabiggestbird
    @ohimdabiggestbird 4 месяца назад

    finally im saving this bad boy until i learn moderngl so i can apply this so i feel better about myself

  • @magoninhogamer
    @magoninhogamer 6 месяцев назад

    Nice video

  • @kendeki
    @kendeki 6 месяцев назад

    🔥

  • @cheesepop7175
    @cheesepop7175 2 месяца назад

    1:28 Doom does not use raycasting.

  • @whtiequillBj
    @whtiequillBj 6 месяцев назад +3

    no. Doom was NOT a ray-caster! It used binary-space-partitioning.

    • @pythonista_333
      @pythonista_333  6 месяцев назад +1

      Didn't know that :O

    • @whtiequillBj
      @whtiequillBj 6 месяцев назад +2

      3D Sage has some great videos on developing both a ray cast engine and binary space partition engine. His videos are between beginner and intermediate coding. But the videos expects you may know nothing and simply want to learn.

    • @pythonista_333
      @pythonista_333  6 месяцев назад +1

      @@whtiequillBj 3D Sage videos were actually the reason why I made my own tutorial. I didn't like the way he explained the code and, for a beginner, I thought it would be tough to understand.

    • @ErcepBayram
      @ErcepBayram 5 месяцев назад +1

      @@pythonista_333 he is over focused on trying to be funny. Your video is much better.

    • @oliverhudson8821
      @oliverhudson8821 5 месяцев назад

      I believe binary space partitioning is not the method used to render, but returns what gets rendered; saving memory. The rendering method is, i believe, similar to raycasting.