Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Particle Simulator in C++/SFML/OpenGL  (Read 5468 times)

0 Members and 1 Guest are viewing this topic.

Syntactic Fructose

  • Jr. Member
  • **
  • Posts: 80
  • Overflowing stacks and eating snacks
    • View Profile
Particle Simulator in C++/SFML/OpenGL
« on: October 22, 2014, 03:16:58 am »
After a couple months of tinkering around with SFML and OpenGL here's my finished product!

At first look(left: default color scheme, right: random color scheme):


Download and View more on Github: https://github.com/Syntaf/ParticleSimulator

What Exactly Is This Doing?
The simulator currently combines mouse input with newtons second law of motion d = (1/2)at2 + vit. Particles continually accelerate towards the mouse point while the user holds down LMB. Once released, a constant drag force is applied until the particles eventually grind to a half, making for some pretty near formations in the simulation!

Can I Change Stuff?
Of course, just about every variable can be modified during runtime to change the environment the particle live in. The console positioned to the left of the program handles all input and commands so you can create your own custom world and play around with the particles. You are able to manipulate the:
  • Drag
  • Mass
  • MouseForce
  • ParticleCount
  • Color_r/g/b/a

these commands can be changed at anytime during runtime(except particle count, that is called in the cmd args) by using get and set. An example would be:
> get drag
20.0f
> set drag 50
> get drag
50.0f
to see all available commands, make sure to take advantage of the help <> command

Future Ideas Or Suggestions
I am always open to suggestions on to improve this program. If you have any suggestions, issues or comments leave them here or on the github page, either way works! Better yet, join in, I can never have enough contributors to the project.
« Last Edit: March 30, 2015, 08:03:28 am by Syntactic Fructose »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: Particle Simulator in C++/SFML/OpenGL , now (pretty much) finished!
« Reply #1 on: October 22, 2014, 09:04:49 am »
Looks really cool. :)

Do you have some binaries by any chance? :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Syntactic Fructose

  • Jr. Member
  • **
  • Posts: 80
  • Overflowing stacks and eating snacks
    • View Profile
Re: Particle Simulator in C++/SFML/OpenGL , now (pretty much) finished!
« Reply #2 on: October 22, 2014, 09:14:23 am »
Check under the release tab on github(or https://github.com/Syntaf/ParticleSimulator/releases). These are compiled using x64 , so if anyone still by chance uses 32 bit I could possibly recompile it myself and upload an additional release.

zmertens

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Particle Simulator in C++/SFML/OpenGL , now (pretty much) finished!
« Reply #3 on: October 23, 2014, 06:44:54 am »
This is great! It works really well. I like how its interactive.
The truth will set you free but first it will piss you off.

TheKingArthur

  • Guest
Re: Particle Simulator in C++/SFML/OpenGL , now (pretty much) finished!
« Reply #4 on: October 23, 2014, 05:45:56 pm »
Great ! Looks very beautiful !

xerca

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Particle Simulator in C++/SFML/OpenGL , now (pretty much) finished!
« Reply #5 on: October 24, 2014, 08:49:53 pm »
This is so amazingly beautiful

 

anything