Quadtree Explanation

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • An explanation for laymen of one usage of quadtrees.

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

  • @williammanning7207
    @williammanning7207 5 лет назад +345

    Wow! I uploaded this thing for a school project 4 years ago and now suddenly it has 33k views? What a neat surprise. I'm glad it's helped people!

    • @TheWebPotato
      @TheWebPotato 4 года назад +18

      Thanks for uploading, William. It helped a lot.

    • @VirtuelleWeltenMitKhan
      @VirtuelleWeltenMitKhan 4 года назад +8

      Yep, well done explanation.

    • @longjohn7992
      @longjohn7992 3 года назад +8

      Oh
      That was ur old channel

    • @cancername
      @cancername Год назад

      Thank you! This helped a lot!

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

      i dunno i was specifically looking for it thank you

  • @NoVIcE_Source
    @NoVIcE_Source 8 месяцев назад +40

    "squares are simple shapes and computers are very fast"
    this actually sounds like a cool quote

  • @Ro_void
    @Ro_void 6 месяцев назад +14

    Gotta love when random school projects are better at explaining the concept then the teacher

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

      yo, which course are you pursuing?

  • @baoduyhoangnguyen571
    @baoduyhoangnguyen571 5 месяцев назад +7

    9 years later this video just save my life and my project

  • @qwertyuuytrewq825
    @qwertyuuytrewq825 5 лет назад +26

    A long time ago I was playing Worms and wandering about that cool destructible terrain. Thanks for explaining how it could be implemented.

  • @breemudi
    @breemudi 3 года назад +3

    squares are simple shapes and computers are very fast...✨

  • @Kaiju_Tea_Party
    @Kaiju_Tea_Party 7 лет назад +50

    Your voice gets MUCH louder at 1:03 and then gets quiet again.

  • @Thesoccerdood
    @Thesoccerdood 9 лет назад +18

    Thanks so much!! Now I can finally go and read the complex description my class gave and understand it clearly now.

  • @justhallowed8499
    @justhallowed8499 4 года назад +5

    This video is still helping people 6 years later

  • @LucasofAppalachia
    @LucasofAppalachia 6 лет назад +9

    Very simple, concise explanation. Thank you!

  • @cholushkin
    @cholushkin 2 года назад +6

    Hmm, I tought we don't really need a quadtree in games like worms. There you just need to store a bitmap. And all game logic such as physics collision deyection, explosions and so on works with bitmaps. Good example of using a quad tree is finding a closest objects for a big ammount of moving objects

  • @acking0273
    @acking0273 Год назад +2

    ik this is eight years old at this point but still very cool, definitely going to testing with these too see how the visualization of the tree changes with terrain changes

  • @CYON4D
    @CYON4D 7 лет назад +14

    Great explanation of quadtrees.
    The terrain example reminds me of Worm's terrain system. I guess they used quadtrees aswell.

  • @SciKot
    @SciKot 13 дней назад

    WE CAN ACTUALLY APPLY THIS!
    Holy... but thanks anyway

  • @manxuma123
    @manxuma123 10 месяцев назад +1

    Thanks. Very interesting and informative

  • @gummiglas5571
    @gummiglas5571 2 года назад +1

    that volume difference at 1:00 hahaha

  • @afonsodolmen4759
    @afonsodolmen4759 3 года назад +1

    So, the value of the root is the width and height of the canvas?

  • @WhompingWalrus
    @WhompingWalrus 3 года назад +1

    Would this be much more efficient than storing the terrain as a 2d grid of binary values, and just interpolating if the display resolution is higher than pixel density?

    • @raniem4368
      @raniem4368 3 года назад +4

      Yes, Because if you have a giant section with no terrain border, with your approach you would need to check each pixel. In this approach you check a section of pixels instead.

    • @WhompingWalrus
      @WhompingWalrus 3 года назад +3

      @@raniem4368 Ah that makes perfect sense - you only really store detail where it's necessary with this method, rather than always using the maximum amount of detail even on simple geometry/data. Thanks (:

  • @codeKhana01
    @codeKhana01 7 месяцев назад

    I'm from 2024 drop your year

  • @magicalpopsicalyt1
    @magicalpopsicalyt1 9 лет назад +2

    I like this explanation, thanks :D

  • @starplatinum3305
    @starplatinum3305 9 месяцев назад

    I need u to be my teacher ngl 😭😭😭

  • @woodyTM
    @woodyTM 2 года назад

    still waiting on the Octree Explanation video

  • @RickCharf
    @RickCharf 4 года назад +1

    Concise and excelent video! Thank you

  • @nicoletaplaian9500
    @nicoletaplaian9500 4 года назад +3

    So this is how that game Worms was done... niiice

  • @AntoineVanGeyseghem
    @AntoineVanGeyseghem Год назад

    Wow ! :o

  • @izzyblackout1090
    @izzyblackout1090 6 лет назад +3

    Can you do more explanation on this topic? Like how the octree programming code looks like?

    • @storerestore
      @storerestore 5 лет назад +3

      Octrees are similar but extend into the third dimension. So instead of a rectangle at the root you have a box, and instead of subdividing it into four rectangles you subdivide it into 8 boxes. Traversing the tree to check for collision with a point can be done with a recursive algorithm that starts with the root box/rectangle:
      1. Check whether the node contains the point
      2. If it does not, return no collision
      3. Check whether there is some element that you could collide with within the node (this should be a single flag for each node)
      4. If there is not, return no collision
      5. Check whether this node has child nodes
      6. If there are not, return collision
      7. Call into the function again for each child
      8. If any of the calls to the children return collision, return collision
      There are some optimizations that can be made here at the expense of clarity. Some obvious ones: to avoid call overhead if you know that all points you'll check are contained within the root node, you can do the initial check whether the point is in a node for each child at step 7. You can also avoid unnecessary calls by returning early at step 7 if you find a collision, since a collision with a point can only ever occur within a single node.

  • @guillermoraya3363
    @guillermoraya3363 2 года назад

    Neat little video, dude! Great explanation.

  • @user-pr6ed3ri2k
    @user-pr6ed3ri2k Год назад

    Does it approximate the gorund

  • @martinschurig1131
    @martinschurig1131 7 лет назад +1

    Excellent video!

  • @abdelz1617
    @abdelz1617 2 года назад

    Great video, thank you!

  • @ajitkar3837
    @ajitkar3837 8 лет назад +1

    very simple thanks

  • @UltraGrater
    @UltraGrater 3 года назад

    damn thats smart

  • @Rouliousin
    @Rouliousin 6 лет назад

    Thanks ! I just understand how quadtree works in spatial indexes !

  • @hoki8296
    @hoki8296 Год назад

    Great Help Bro~~~~!

  • @zainulmuttaqin7565
    @zainulmuttaqin7565 3 года назад

    very great explanation, this is pretty short explanation yet so easy to understand

  • @guanpenggao1463
    @guanpenggao1463 3 года назад

    great video and clear explaination

  • @javierpastor8139
    @javierpastor8139 3 года назад

    Pretty good video!

  • @jasonw519
    @jasonw519 5 лет назад

    very straightforward

  • @sayochikun3288
    @sayochikun3288 2 года назад

    thanks

  • @boz9370
    @boz9370 5 лет назад

    Great explanation it really helped.

  • @sweetberries4611
    @sweetberries4611 5 лет назад

    Thank you a lot!

  • @diliupg
    @diliupg 6 лет назад

    very nicely explained in simple terms.

  • @hamamathivha6055
    @hamamathivha6055 7 лет назад

    Nice explanation boy-o

  • @giancarloandrebravoabanto7091
    @giancarloandrebravoabanto7091 6 лет назад

    *my next challenge

  • @slack128
    @slack128 6 лет назад

    Thank you

  • @MrPoutsesMple
    @MrPoutsesMple 8 лет назад

    Thanks !

  • @47lokeshkumar74
    @47lokeshkumar74 Год назад

    Can you share code