First physics solver

  Рет қаралды 30,628

Pezzza's Work

Pezzza's Work

5 жыл бұрын

Little test using verlet integration

Пікірлер: 36
@chrischiesa3253
@chrischiesa3253 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@creeloper27 thank you! I did update them :)
@dandymcgee
@dandymcgee 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 3 жыл бұрын
Pretty awesome work, man. Brilliant.
@trvjbr
@trvjbr 3 жыл бұрын
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 3 жыл бұрын
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 2 жыл бұрын
@@PezzzasWork I just realized how MUCH more simplified of an approach this is! 3D, is the question, though.
@destiny_02
@destiny_02 2 жыл бұрын
Step 1: f**k python Step 2: Profit ??
@awesomecronk7183
@awesomecronk7183 2 жыл бұрын
@@destiny_02 Never!!!!
@awesomecronk7183
@awesomecronk7183 2 жыл бұрын
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.
@lucapasini078
@lucapasini078 3 жыл бұрын
What are you using for graphics?
@eboatwright_
@eboatwright_ 2 жыл бұрын
Really awesome!
@mlab3051
@mlab3051 3 жыл бұрын
Have you try fluid simulation?
@ImXyper
@ImXyper 2 жыл бұрын
wow this is amazing
@atult9096
@atult9096 2 жыл бұрын
Can you share the physics/ Math behind them. Thanks.
@garfield2804
@garfield2804 2 жыл бұрын
wow looks cool
@tyler2854
@tyler2854 3 жыл бұрын
Cool!
@madkirk7431
@madkirk7431 2 жыл бұрын
Already seems like it has potential to be a good game, and I don't think it's even meant to be one.
@papua5560
@papua5560 3 жыл бұрын
how did you code the softbodies?
@PezzzasWork
@PezzzasWork 3 жыл бұрын
It is just objects linked by distance constraints
@papua5560
@papua5560 3 жыл бұрын
oh!
@akashdeepkar1547
@akashdeepkar1547 3 жыл бұрын
This is amazing. Mind sharing the git?
@PezzzasWork
@PezzzasWork 3 жыл бұрын
I will post it on GitHub, it is a very old code
@artwriter7377
@artwriter7377 Жыл бұрын
How he is creating gui/graphic is he using some module/library can you suggest some for me ??
@arturm3917
@arturm3917 Жыл бұрын
SFML
@artwriter7377
@artwriter7377 Жыл бұрын
​@@arturm3917 is there any equivalent in c.
@deepsender
@deepsender Жыл бұрын
@@artwriter7377 GLFW, GLUT, SDL with OpenGL are some choices.
@retsopmisv
@retsopmisv 4 ай бұрын
is this possible on scratch?
@gmdrandom6287
@gmdrandom6287 3 ай бұрын
Absolutely, but performance may be bad
@FrozenDonkey71
@FrozenDonkey71 8 ай бұрын
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 (kzbin.info/www/bejne/j4bcd3RvbrqBmqc) 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 3 ай бұрын
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 Ай бұрын
NAME THE GAME?????????????????????????????????????????????????????
Realtime cloth simulation
1:08
Pezzza's Work
Рет қаралды 2,3 МЛН
Creating a Brick Breaker with my PHYSICS ENGINE
7:21
Pezzza's Work
Рет қаралды 109 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 20 МЛН
FOOTBALL WITH PLAY BUTTONS ▶️ #roadto100m
00:29
Celine Dept
Рет қаралды 74 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 27 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 44 МЛН
Ellipse reminds you of its focal points
5:10
Alexander Gustafsson
Рет қаралды 176 М.
Writing a Physics Engine from scratch
9:24
Pezzza's Work
Рет қаралды 190 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 905 М.
Sounds of the Mandelbrot Set
9:32
CodeParade
Рет қаралды 2,7 МЛН
Evolving AIs - Predator vs Prey, who will win?
12:15
Pezzza's Work
Рет қаралды 2,8 МЛН
Creating a Space Invaders clone using my C++ engine and SFML
11:58
Pezzza's Work
Рет қаралды 36 М.
Nez Verlet Physics Iteration 4: Now with collisions
0:10
Mike Desaro
Рет қаралды 889
Finally, Deformation Simulation... in Real Time! 🚗
6:56
Two Minute Papers
Рет қаралды 492 М.
Real time Fire Simulation
7:23
Pezzza's Work
Рет қаралды 153 М.
The Physics of BeamNG
5:00
SkyFall
Рет қаралды 62 М.
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 32 МЛН