Jump to content
  • Advertisement
Sign in to follow this  
Finalspace

C++ NBody Fluid Simulation Experiment

This topic is 431 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just for fun i have written a simple C++ 2D nbody fluid simulation in 4 different programming styles - just to see the differences in speed and maintainability.

Its like my "Fluid Sandbox" program i have written in the past, but 2D and without rigidbody interaction - maybe that will come later.

It would be great if you can compile and run it and check the results for yourself.

 

There is a built-in benchmark recording and rendering, so you can compare all 4 demos with your own system.

 

It was build in visual studio 2015/17 but it may compile on other compilers as well - because it uses simple syntax and default libraries, like glut, glew and opengl.

 

Feedback is welcome -> see the associated feedback thread.

 

You can find the project source here:

https://github.com/f1nalspace/nbodysimulation_experiment

 

Also if you just want to start it up, here is the executable:

http://root.xenorate.com/final/gamedev/nbodysimulation_experiment_v1.1.zip

 

Greetings,

Final

 

nbody_shot1.png

nbody_shot2.png

Edited by Finalspace

Share this post


Link to post
Share on other sites
Advertisement

I commited a intense update with a full rewrite of the rendering and font system.

I implemented a command-buffer like system, so rendering is independent from the graphics api now, which is great.

Also i use STB_truetype to load and calculate fonts, so i get much better looking fonts and can finally adjust the size as well.

 

But it seems i got a bug in regards using glDrawElements, crashing the rendering when glTexcoordPointer is used. Therefore i just draw the elements by byself and IFDEF´ed out the glDrawElements part.

Edited by Finalspace

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!