Gravity Simulator
http://www.orbitsimulator.com/cgi-bin/yabb/YaBB.pl
General >> Discussion >> Personal side project
http://www.orbitsimulator.com/cgi-bin/yabb/YaBB.pl?num=1293123577

Message started by ssc4k on 12/23/10 at 08:59:37

Title: Personal side project
Post by ssc4k on 12/23/10 at 08:59:37

In order to introduce some new stuff into my knowledge of c++ over break I thought I would make a more relaxed (centered around being fun, not accurate) interactive gravity simulation. Unfortunately it doesn't really do much more than one would expect from these sorts of programs:

escape = close
c = clear screen
space = pause
v = change view, currently 3 modes. 1 = normal, 2 = point, 3 = velocity.
l-click = create new moving particle, drag before releasing to create velocity, the longer you hold the bigger the mass
r-click = create new stationary particle, the longer you hold the bigger the mass
plus/minus = increase/decrease simulation accuracy
arrow keys = move camera
h = home
t = trace
s = save contents to save.grv (no load function yet)

But I invite you all to check out the projects homepage (http://code.google.com/p/interactive-gravity/) and download (http://code.google.com/p/interactive-gravity/downloads/list) the latest installer. Any input is welcome as I have 90% of break left.

Title: Re: Personal side project
Post by Tony on 12/25/10 at 01:20:44

Nice job.  It's hard to pick the right velocity to get an orbit, but it was fun trying.  I couldn't keep the system centered though.  It kept moving off the screen.

Title: Re: Personal side project
Post by abyssoft on 12/29/10 at 12:00:34

adding a zoom feature is always a good idea, makes it easier to keep system on screen.

Title: Re: Personal side project
Post by frankuitaalst on 12/30/10 at 11:47:32

I've found some nice features such as for creating new masses and giving them a velocity and direction on screen.
I also got a system with some fixed masses , through which an extra body can manoeuver in a way I've never seen before .
Nicely done !

Title: Re: Personal side project
Post by ssc4k on 12/31/10 at 10:16:43

Wow I expected everyone would think it was complete crap to be honest XD well I'll odd object tracking, zoom, load (you can save in human readable format but not load yet), and some other changes. Thanks for the input and check back next week for that stuff to be implemented :P.

EDIT: v1.9.1 has full save/load capability, it will save camera, mode, and object data into a human readable text format in save.grv. The format is as follows
line 1: how many objects there are
line 2 though line 11 * objects +1: object data lines = (1 = x, 2 = y, 3 = x velocity, 4 = y velocity, 5 = mass, 6 = alive , 7 8 9 = r g b, 10 = radius, 11 stationary?)
line 11 * objects + 1 through line 11 * objects + 4: camera (1 = x, 2 = y, 3 = zoom factor)
line 11 * objects + 1 through line 11 * objects + 4: 1 = draw mode (2 = mode count, 3 = pause, 4 = trace)

or if you just want to save and load it's "s" for save "l" for load :P

Title: Re: Personal side project
Post by Tony on 01/26/11 at 00:22:01

I just noticed your "Edit".  That's the problem with edits.  It doesn't show up as a new post, so nobody reads it.  I'm anxious to try your improvements!

Gravity Simulator » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.