Mesh from Math - The basics of Marching Cubes

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 21

  • @cx123456
    @cx123456 Місяць тому +1

    A multidimensional array represented as a 1D flat array is called strided array.
    Another, very specialized variant, is bitboard, where you represent a 2D array of booleans as an integer.

  • @XanTheDragon
    @XanTheDragon 8 місяців тому +2

    I am so glad I saw this video in the suggestions after watching the same video you did.

  • @rishabhchopde6709
    @rishabhchopde6709 Місяць тому

    This video helped me out enough to implement this myself in C# and I was able to generate meshes for implicit geometry. I'm now looking for a way to better approximate it, so I'm looking up how to implement the dual contouring "Surface Nets" algorithm.

  • @jupiterbjy
    @jupiterbjy 4 місяці тому +1

    I was scratching head watching Sebastian Lague's Marching cube video as it's example is in compute shader with unity which in godot it's hilariously complex to use - now this video helps me understand better.
    Not to say SL's one was bad but found myself dumb to understand it due to engine difference(I think)

  • @nebulae_wanderer
    @nebulae_wanderer 8 місяців тому

    Damn i was on a threejs implementation of this. Your video helped me a shitton. Also if someone comes here with the issue that the cubes are at the right place but in seemingly random orientation, try flipping the binary index. Turns out I was reading the points in reverse when building it.

  • @eitantal726
    @eitantal726 5 місяців тому +1

    Simple & short explanation: How to make something that's minecrafty look less minecrafty, with 1st order interpolation

  • @devin6329
    @devin6329 Рік тому +8

    This is a really great explanation of the marching cube algorithm 👍

  • @ThatKid22101
    @ThatKid22101 27 днів тому

    everyone else:
    me at 0:10: I literally just watched that video!

  • @bargledargle7941
    @bargledargle7941 10 місяців тому

    Amazing video! Helped me a lot to understand it and also it's well made.

  • @JohnLauerGplus
    @JohnLauerGplus 6 місяців тому

    nice work!

  • @austineldredge8003
    @austineldredge8003 Рік тому +4

    Created something very similar lately in an attempt to make modifiable procedural terrain at runtime. The issue Im running into is linear interpolating based on noise values to improve the shape of the cubes, have you done any work on this?

    • @DeadlockCode
      @DeadlockCode  Рік тому +3

      Assuming you're talking about the thing I hinted to at the end (6:35); I'm thinking about making a video appending this one but that might be a while, since I'm currently working on something else entirely. So I'll try to answer it here as detailed as I can.
      During the creation of the vertices, we place it at the center (6:10) but we want to place it where we expect to find '0' (if the transition were linear). Then we also need the values of the two voxels adjacent to the vertex;
      replace:
      let position = (pos_a + pos_b) * 0.5;
      with:
      let val_a = voxel_grid.read(x + x0, y + y0, z + z0);
      let val_b = voxel_grid.read(x + x1, y + y1, z + z1);
      let t = val_a / (val_a - val_b);
      let position = pos_a + (pos_b - pos_a) * t;
      Hope this helped. If there's anything I explained poorly, feel free to ask.

  • @pieriskalligeros5403
    @pieriskalligeros5403 Рік тому +3

    0:30 I didn't spot the perlin noise? @Deadlock

    • @DeadlockCode
      @DeadlockCode  Рік тому

      Yeah, I'm sorry about that. Previously, I had a 30 second 'teaser' where I showed an example of what marching cubes can do but it felt too slow. So I removed it to get straight to the point, but I had forgot that the following scene had a reference to it.

    • @adamebadra3171
      @adamebadra3171 Рік тому

      ​@@DeadlockCodeis that hlsl??

  • @GES1985
    @GES1985 10 місяців тому

    Is this similar to using the equivalent of minecraft voxels but not rendering them; instead, calculating a flexible "blanket" that smoothly lays over the active (invisible) blocks, and takes their data as reference for what materials/ textures/ actors belong with the rendered "blanket" landscape that spans between the invisible blocks vertices?

  • @padaddadada5417
    @padaddadada5417 3 місяці тому

    Thank you !
    In what language is it written ?
    What do you use to render the image in 3D in your video ?

    • @DeadlockCode
      @DeadlockCode  3 місяці тому +1

      All the code is written in Rust and I used the Bevy Engine to animate and render the 3D elements of this video.

    • @padaddadada5417
      @padaddadada5417 3 місяці тому

      Thank you !