As some might have heard, I'm currently working on a groundbreaking new 3D engine, based not off of triangles... but off of the p5js line() function. In case that sounds stupid, let me explain: there's this buff project on Scratch called Vectoid TD3D, which basically uses the same system of drawing.
Anyways, I am going well on with my project (I have some really cool models right now that I am using to test), and while my 3D models render perfectly, are very easy to manipulate, and all and all and all...
IT'S DAMNED SLOW.
I have experimented with removing the Z-sorting of vertices entirely, and that seems to be the biggest source of FPS drop in my project. Without sorting, I can get consistent 30 FPS. However, without Z-sorting, my stuff looks like it was made by someone half my age. Thus, I will ask all of you: do you know any sorting method for vertices? The vertices are stored in the following format:
[[x,y,z],[x1,y1,z1],[x2,y2,z2]]
Please only respond to this post if you have a decent understanding of 3D and sorting.

Thank y'all!

    Try KA for performance, KA consistently gets about 2.5x the frame rate of CDO

      Ravage in my experience the line draw call is slower than the rect one unless they fixed that also for the way your storing those coords may be better to use the p5 vector calls as for the sorting at the current time i don't have a good solution other than some implementation of quicksort at the moment but thought I'd add my input in.... also some older games used triangles to generate shapes rather than just lines.... not sure what would be better though

      however i do know of people who have been playing around more with 3d more than i have so i'd definitely recommend asking

      • at
      • letti
      • dragonfiregames

      CDO wasn't really optimized for 3D so I'll be surprised on what your library can squeeze out of it

        Varrience The line draw call might be slower, but it also allows for slants. Hence, rect() is out of the question (unless you know of a way to make it slanted).
        Also, thanks a lot for suggesting that I use p5.js Vector(). I can now take advantage of mutability and fix another massive FPS dropping issue.
        As for the quicksort, I found a decent-looking method off of [some other platform] that seems decent. Finally, I must emphasize that my game's 3D models are all based off of lines, because I've seen what can be done with that and it's pretty cool.
        As for the suggested contacts:
        I can't contact Owokoyo because his light is too strong and could blind me (also I don't have Discord).
        I can't contact Letti either because reasons.
        I'll try DragonFireGames. I've seen his 3D Minecraft and it's interesting.

        Also, yeah, I noticed that CDO isn't optimized whatsoever, but we'll try, because I have nothing else to do :)

          Have you tried looking into scratchapixel it has a step-by-step tutorial on implementing a rasterizer, one of those steps is z-sorting.

          ackvonhuelio Engineering is not making the best with the best. It's making the best with what you have. CDO is a challenge inasmuch as it is very limited. As Owokoyo said, though, we must get "code.org to its limits."

            Ravage You could also try shape(), it works like rect() but you can make slants and multiples lines. Not sure how it does with performance though.

              Binary_Coder Actually I found that p5js rotate() works better than line() or shape(). The latter two consistently clocked 80 ms, the rotated rectangles (rounded, of course) got 60 ms in a 100-object test. Seems that Varrience was right. Why am I surprised. I shouldn't really be.

              Ravage
              if you really wanna limit yourself...
              seems like poor logic to make life harder for yourself but if you really want that feeling of "omg i got something to work on cdo i'm so smart" then okay.

                ackvonhuelio just let them do what they want jesus christ no one is going to go over to ka with you
                if anyone wanted to not limit themselves they certainly wouldn't be using ka either

                  Letti42
                  ravage did say that their program was slow, and i wanted to help, i'm not preventing them from ''doing what they want", just suggesting KA for better performance.

                  also tf you mean "just let them do what they want jesus christ" I'm not doing anything to prevent people from doing what they want im just sharing my opinions

                    ackvonhuelio No, seems like you're bashing on all of us CDO users for using CDO. I will cite you:
                    "seems like poor logic",
                    Saying that what we're looking for is "omg i got something to work on cdo I'm so smart",
                    "tf you mean stoop down ur at CDO that's the lowest of the low"

                    If you have any more evidence to give me, please feel free to do so.

                      ackvonhuelio No, seems like you're bashing on all of us CDO users for using CDO. I will cite you:
                      "seems like poor logic",
                      Saying that what we're looking for is "omg i got something to work on cdo I'm so smart",
                      "tf you mean stoop down ur at CDO that's the lowest of the low"

                      If you have any more evidence to give me, please feel free to do so.

                      Ravage
                      I am saying tha KA is better
                      I am advising that you use KA for better performance
                      I am not preventing you from doing what you want, which is what letti said

                      Letti42 just let them do what they want jesus christ

                      person
                      considering the message was targeted at me, yes i took that personally

                      Ahh it appears he agrees

                      Chat