First physics solver

Sdílet
Vložit

Komentáře • 36

  • @chrischiesa3253
    @chrischiesa3253 Před 4 lety +67

    As a C++ programmer of over 20 years' experience, I'd sure like to know how you're writing these things. I've been trying to do things like raytracing, physics sims, and collision sims (saw your video about that cool bug), "from scratch" with no libraries or anything -- but I can barely even do *graphics* in C++, let alone anything either 3D, fast-moving, or that handles lots of objects. What graphics I've managed to do -- interpretation of ancient image file formats I used in the 80s, and so forth -- are primitive and very slow. (For that file-format thing, on my old Windows XP laptop the Perl implementation is actually *faster* than the C++ one! :-o )

    • @PezzzasWork
      @PezzzasWork  Před 4 lety +37

      Almost all the codes related to my videos are on Github (github.com/johnBuffer/ ) if you want to check it. Its not fabulously beautiful code as I tend to priorize speed over quality when I am experimenting.
      As for the graphics it is really easy thanks to the SFML, a C++ lib which is an amazing wrapper around opengl making it really intuitive to use with a very good object oriented design (and the doc is pure pleasure www.sfml-dev.org/ ). The 3D projects I made are almost all using SFML (except for the sdf raymarching one using GLFW as SFML does not support compute shaders) since I am using raytracing so I take care of the 3D part myself. I also love the from scratch approach, that's why I don't use libs in my projects except to wrap opengl things. Doing everything is to me the best way to deeply dive into a subject.

    • @PezzzasWork
      @PezzzasWork  Před 4 lety +4

      @@creeloper27 thank you! I did update them :)

    • @dandymcgee
      @dandymcgee Před 3 lety +3

      I would also recommend checking out Raylib if you prefer C style coding over C++. Its 2D functionalities are substantially more performant than SFML and I find it much easier to use. It also has a ton of other utility functions that SFML doesn't offer, and the developer is very kind and helpful and willing to respond quickly to bug reports, unlike SFML which ran by developers who are extremely toxic. I've been using it for my latest 2D top-down project after porting from SFML, and it's been a pure joy.

  • @dandymcgee
    @dandymcgee Před 3 lety +1

    Pretty awesome work, man. Brilliant.

  • @trvjbr
    @trvjbr Před 3 lety +28

    This is awesome! I am trying to implement collision detection of arbitrary shapes in Python, with rotation and everything, and apparently one solution to this is to consider the shapes as bunches of circles. One thing I haven't figured out yet is how to prevent the shapes from overlapping; also my code is a bit slow and I don't think it is (only) Python's fault. Therefore would you mind sharing your code or giving some reference so i could implement the maths used please? Thank you for sharing these stuff anyway, I just discovered your channel and I am already a fan.

    • @PezzzasWork
      @PezzzasWork  Před 3 lety +6

      Compose objects as a set of circles is quite simple and fast since you just have to consider circle-circle collisions with elements of the same size but if you want real rigid bodies it is quite challenging. Here is the repo a new version of this project github.com/johnBuffer/UnitedEngine

    • @Brahvim
      @Brahvim Před 2 lety +1

      @@PezzzasWork I just realized how MUCH more simplified of an approach this is!
      3D, is the question, though.

    • @destiny_02
      @destiny_02 Před 2 lety +3

      Step 1: f**k python
      Step 2: Profit ??

    • @awesomecronk7183
      @awesomecronk7183 Před 2 lety

      @@destiny_02 Never!!!!

    • @awesomecronk7183
      @awesomecronk7183 Před 2 lety

      One thing you can try doing to make python projects run faster is compile them to C with Nuitka once you have them working slowly. Nuitka eliminates the fetch and decode cycles of the interpreter and then compiles the C equivalent of what the interpreter would do when it ran your code into a binary to run on your OS.

  • @eboatwright_
    @eboatwright_ Před 2 lety

    Really awesome!

  • @ImXyper
    @ImXyper Před 2 lety

    wow this is amazing

  • @garfield2804
    @garfield2804 Před 2 lety

    wow looks cool

  • @tyler2854
    @tyler2854 Před 3 lety

    Cool!

  • @lucapasini078
    @lucapasini078 Před 3 lety

    What are you using for graphics?

  • @mlab3051
    @mlab3051 Před 3 lety

    Have you try fluid simulation?

  • @atult9096
    @atult9096 Před 2 lety

    Can you share the physics/ Math behind them. Thanks.

  • @madkirk7431
    @madkirk7431 Před 2 lety +1

    Already seems like it has potential to be a good game, and I don't think it's even meant to be one.

  • @akashdeepkar1547
    @akashdeepkar1547 Před 4 lety +5

    This is amazing. Mind sharing the git?

    • @PezzzasWork
      @PezzzasWork  Před 4 lety +5

      I will post it on GitHub, it is a very old code

  • @papua5560
    @papua5560 Před 3 lety +1

    how did you code the softbodies?

  • @artwriter7377
    @artwriter7377 Před rokem +1

    How he is creating gui/graphic is he using some module/library can you suggest some for me ??

    • @arturm3917
      @arturm3917 Před rokem +1

      SFML

    • @artwriter7377
      @artwriter7377 Před rokem

      ​@@arturm3917 is there any equivalent in c.

    • @deepsender
      @deepsender Před rokem +1

      @@artwriter7377 GLFW, GLUT, SDL with OpenGL are some choices.

  • @retsopmisv
    @retsopmisv Před 5 měsíci

    is this possible on scratch?

    • @gmdrandom6287
      @gmdrandom6287 Před 3 měsíci

      Absolutely, but performance may be bad

  • @FrozenDonkey71
    @FrozenDonkey71 Před 8 měsíci

    The solid bodies seem to be somewhat "jelly-like", is it intended? Are the contraints "solid" as rods or "stretchable" as springs? The bodies in this more recent video (czcams.com/video/YUyFA99UNdE/video.html) behave much "solider", have you updated your algorithm? By the way, all your videos are so cool. You haved created things that I have been dreaming for.

    • @gmdrandom6287
      @gmdrandom6287 Před 3 měsíci

      The jelly-ness may be caused by how the distance constraints are done. He most likely only enforces each constraint once per update, which means that other constraints being solved start to push already solved constraints out of whack. In the more recent video, he might've just enforced the constraints multiple times per physics update.

  • @Reginaldorossety
    @Reginaldorossety Před měsícem

    NAME THE GAME?????????????????????????????????????????????????????