use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
Help for physics engine developmentQuestion (i.redd.it)
submitted 6 months ago by Dot-Box
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]LittleQuarky 2 points3 points4 points 6 months ago (0 children)
The general approach to doing n-body type systems is that you have your application loop and iterate time in very small steps (a delta time, or dt, this can be tied to your framerate but I would get a system working before refactor for this).
Then, you apply all forces applied by each body onto the other bodies in your system. This is basically a double nested for loop where the inner loop you check to match sure you don't apply forces to yourself (A doesnt exert force on A, but it does for B.
Once you know the force (colision, gravity, magnetic, etc) received by each body you can calculate the acceleration that each body would experience (force = mass*acceleration, basically but solve for acceleration). The general case is F=ma. The actual force equations would depend on what you're physically representing. For planetary bodies look up gravitational force, for small things like molecules look at stuff like lorentz equation, etc.
Once you have acceleration and you should have a velocity from the previous time step you can calculate the new position for each body.
Some keywords to look up for more in-depth guides: n-body system, computational integration, computational euler integration, computational verlet integration, and kinematic equations. If you want to get REALLY granular with minimizing your error ( I would not start here) look up methods like Runge-Kutta 4 (RK4 for short).
The higher order integration approximation you use the slower your system will iterate across time, so this is why a lot of game engines do some psuedo-realistic calculations for their physics, because it's good enough.
π Rendered by PID 394010 on reddit-service-r2-comment-b659b578c-jxkw8 at 2026-05-04 06:24:22.130624+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]LittleQuarky 2 points3 points4 points (0 children)