Game Dev Engine #12. Order from Chaos: Sierpiński Triangle.

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2023
  • 2023-10-14. The creation of the Sierpiński Triangle can be done in many ways. One of the coolest is the use of random (chaotic) input, and developing order.
    The algorithm could not be more simple:
    1. set 3 origin points (or 4 if you're in 3D).
    2. initialize a point (to anything, but to avoid artifacts, start at one of the origin points).
    3. move 50% the distance to one of the origins (randomly pick one)
    4. repeat step 3, drawing the points each time.
    This is known as "Order from Chaos" from where I first heard it (yes, I spelled it wrong in the demo, did you notice?). It is also called the "Chaos Game" for generating the fractal from randomness.
    I showcase this in 2D and 3D. The rendering in 3D is handled in software on the CPU. No GPU, 4x4 or even 3x3 matrices, involved here (well, I need the GPU to draw the dots!). It uses the core 3D formula that I figured out after many attempts in Grade 8, which is at the root of all perspective correct matrix transforms. I remember thinking with this formula, I could render literally anything... I felt I had discovered the Holy Grail of computer graphics.
    The coloring is interesting as well. Each origin has its own color. If the point it at the origin, that color takes 100% of the precedence of the color choice. If the point is equidistant from two origins, then they contribute the same amount.
    Interestingly, neither the 2D nor 3D versions have points near the center location of the structure, so you'll never see a color of equal mix of all 4 colors.
    Playlists:
    --------------
    - Xona System 8: • Game Dev Engine #1. A ...
    - Voxel: • Voxel Engine #8 - Corr...
    - Ray Cast: • 3D Ray Casting Engine:...
    - Graph-All: • Graph-All Calculator #...
    - Scroll Shmup: • The First Pixel: Dev V...
    - Road: • Pseudo 3D Road #8 - in...
    - Arena Shmup: • Arena Shmup Demo #3 - ...
    - Wave Function: • A.I. High Resolution T...
    - 3D Polygon: • 3D Polygon Engine #9 -...
    - GW-BASIC: • GW-BASIC - Escape From...
    Websites:
    ---------------
    - GitHub: github.com/JDoucette
    - Blog: thefirstpixel.com
    - Studio: xona.com
  • เกม

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

  • @Aaron067
    @Aaron067 8 หลายเดือนก่อน +1

    This is insanely cool!! Absolutely amazing stuff man, keep it up 👍👍

    • @JDoucette
      @JDoucette  8 หลายเดือนก่อน +2

      Thanks so much for the kind compliment. I am thrilled that you are enjoying these little demos. I get a kick out of them myself, and seeing the reactions. There are so many cool things to demo in just the fractal space alone...

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

    This is cool.

    • @JDoucette
      @JDoucette  8 หลายเดือนก่อน +1

      I was thinking about showing more fractals, like the Barnsley fern, like EMF's 1995 demo scene entry, Versus. Remember they designed their own with the words EMF? I researched it quickly, and it's not generated like Sierpinski Triangle (even though their demos includes this). So it's so complicated. It's merely a iterative transform for each point -- closer to the generation of Mandelbrot Set (each point requires a lot of work to generate, to the depth you desire). But still very cool.

    • @JDoucette
      @JDoucette  8 หลายเดือนก่อน +1

      I also have a mode where it regenerates the entire fractal each frame. This way, the dots are random. This sort of gives it a "reality" that a finite set of points do not, since it shows the density or lack of absoluteness of the object over time. It reminds me of accurately rendering complex 3D rims on car wheels as they rotate, or like a fan -- it's a probability field (over a finite time), not a real object.

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

      @@JDoucette That's a cool idea. Like someone's version of how an atom looks like including quantum mechanics... using randomized probability.