Hey,
I have worked on this for some time, but have been busy and so I just decided to post the project on sourceforge so that people can use it even though it's far from finished.
The link to the sourceforge project page is: http://sourceforge.net/projects/t-dphysicssim/
3-DPhysicsSim is an application, that allows you to create scenes, consisting of physical objects and see how to act according to Newtonian laws.
It is intended to be somewhat educational, but it's not quite at that point yet.
You will be able to see the position and velocities of objects. You will be able to graph the object's position and velocities.
You will be able to see how gravitation and electrical forces act on objects and a few other things.
Also keep in mind, I have not actually optimized the code to a good enough extent, and so for example depending on the speed of you computer, you might be able to run the gravitation example smoothly with only a little over a hundred objects.
Currently enough features have been added so that people can mess around with, but be aware there are still many bugs to fix. Also a lot of features are still not implemented.
All features and basic information on how to use it are on the sourceforge page or in readme files.
Also currently it's only available for windows. I will port the application to linux at some point and possibly also to MacOs if ever I get my hands on a Mac.
Hope you find it useful!
EDIT:
Some screenshots:
3-DPhysicsSim
-
- Posts: 15
- Joined: Thu Sep 27, 2007 7:49 pm
3-DPhysicsSim
Last edited by hindupower on Tue Jan 01, 2013 3:57 am, edited 1 time in total.
Re: 3-DPhysicsSim
Nice utility. Good luck with it!
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: 3-DPhysicsSim
Looks nice are you using a physic engine to wicht you are adding your own forces? or did you code the whole physic engine?
and then wich compiler are you using? Cause i have a gravity simulation in my game and could run up to 2 thousand objects with the simulation still being playable when i compiled with vs2010 and the sse2 auto optimisation enabeled. And for a short periode when i tested the intel compiler i could run up to over 4 thousand object with the simulation still playable.
how ever i use bullet for the main physic and bullet itself is already quite optimised
and then wich compiler are you using? Cause i have a gravity simulation in my game and could run up to 2 thousand objects with the simulation still being playable when i compiled with vs2010 and the sse2 auto optimisation enabeled. And for a short periode when i tested the intel compiler i could run up to over 4 thousand object with the simulation still playable.
how ever i use bullet for the main physic and bullet itself is already quite optimised
-
- Posts: 15
- Joined: Thu Sep 27, 2007 7:49 pm
Re: 3-DPhysicsSim
I use Bullet physics, but I do manually add forces at times, for example with springs so that I have more control over it.
If you mean by what IDE I'm using, I'm using Visual C++ 2010 express. I don't think I messed with any optimization settings, but no matter how I look at it 2 thousand objects with "accurate" gravitation forces applied on each other seems almost impossible.
The gravitation part is done by the application and not Bullet physics and the way I was going to optimize it was by using an N-body algorithm if the user is OK with less accurate results(the user would somehow choose the accuracy of the simulation).
Am I misunderstanding something or are you just talking plainly applying a constant gravity force to each object?
EDIT:
Currently the application only runs on one core and like I said I don't use any algorithm to approximate the forces(such as is done in an N-body algorithm). If I were to use the GPU for calculating, then I think that 2000 objects is possible.
I currently have no other ideas on how to optimize it further algorithm wise. If you have any ideas I would be glad to hear them
If you mean by what IDE I'm using, I'm using Visual C++ 2010 express. I don't think I messed with any optimization settings, but no matter how I look at it 2 thousand objects with "accurate" gravitation forces applied on each other seems almost impossible.
The gravitation part is done by the application and not Bullet physics and the way I was going to optimize it was by using an N-body algorithm if the user is OK with less accurate results(the user would somehow choose the accuracy of the simulation).
Am I misunderstanding something or are you just talking plainly applying a constant gravity force to each object?
EDIT:
Currently the application only runs on one core and like I said I don't use any algorithm to approximate the forces(such as is done in an N-body algorithm). If I were to use the GPU for calculating, then I think that 2000 objects is possible.
I currently have no other ideas on how to optimize it further algorithm wise. If you have any ideas I would be glad to hear them
Re: 3-DPhysicsSim
kk in your version every body apply gravitation to each other then ya 2k object is off the table in mine there was only one body aplying gravity.
How ever you could probably make use of a parallel for loop to make each object apply gravity to each other in parallel, Bullet won't panic.
How ever you could probably make use of a parallel for loop to make each object apply gravity to each other in parallel, Bullet won't panic.
-
- Posts: 15
- Joined: Thu Sep 27, 2007 7:49 pm
Re: 3-DPhysicsSim
Thank you for the advice Granyte. I never knew about parallel for loops. After looking it up, I see it would make parallelizing gravitation and electrical forces easier, although I would still have to add some sort of N-body algorithms.
Any advice or criticism is welcomed, because I know there is a LOT to improve on this application. So if anyone has any ideas on how the project could be improved, I would be grateful.
Any advice or criticism is welcomed, because I know there is a LOT to improve on this application. So if anyone has any ideas on how the project could be improved, I would be grateful.