GLBasic forum

Main forum => Beta Tests => Topic started by: Hemlos on 2019-Feb-14

Title: 3d Space Sim
Post by: Hemlos on 2019-Feb-14
its kinda fun, i find myself spending hours every night playing with profiles, formations.
Fact: Most solar systems have a jupiter-like planet circling near the star.
In this sim, you can actually see this sort of thing form, and you can see why it happens (if you watch)
Watching, waiting, thats what this sim is about, theres not much to do except to start the planets and watch them whirl merge and form orbits.
Title: Re: 3d Space Sim
Post by: erico on 2019-Feb-14
collisions with beautiful slow motion explosions too???   ;/
Title: Re: 3d Space Sim
Post by: Hemlos on 2019-Feb-15
its mostly just math physics not much in the way of special effect.
just a toy at the moment, no real plans for this side project.
my big dream is still to do a flight sim. i have all the code i need for one, just not the time i need.
Title: Re: 3d Space Sim
Post by: Hemlos on 2019-Mar-01
collisions with beautiful slow motion explosions too???   ;/

fine ok, as you wish. And how about comets and trails that push away from stars?
How about this lighting from the star to the planets?
These objects all share the same object, they are coloured by another light from the cam position.
Title: Re: 3d Space Sim
Post by: erico on 2019-Mar-01
 <3 That is neat! Would it work better if the planet shading was more "hard", like a cartoon shade?
Looks awesome and I bet even better while moving about. :)
Title: Re: 3d Space Sim
Post by: Hemlos on 2019-Mar-02
<3 That is neat! Would it work better if the planet shading was more "hard", like a cartoon shade?
Looks awesome and I bet even better while moving about. :)
not sure, if it would or not?

heres a close up on the planets moving..
the ones on fire recently absorbed smaller things
the ones with trails (in this scene) are the smallest and original objects flying around, they take on color when they combine with something smaller, and lose the tails.
Title: Re: 3d Space Sim
Post by: erico on 2019-Mar-02
That is great, so you have a whole simulation of accretion disks to form the planets? Do you have different process for rock, gas,ice planets? Rings too?
Title: Re: 3d Space Sim
Post by: Hemlos on 2019-Mar-03
There is a space sandbox simulator if you really want that kind of effect with gas...saw it on youtube
tho it doesn't do accretion disks directly, you can immitate them by shredding stars lol

To answer your q's: yes and yes
basically, during system creation when the profile is chosen, it is an accretion disk engine at the beginning
gas? gas physics are present in the comets, the star pushes the gas tail away from the star.
planets form, its based on solids only, ice...rocks..solid. also....some gas are solid or liquid in deep space anyway, no atmospheres yet.
IRL most of the universe is made of hydrogen, doesn't make a good platform for planets.
supernovae create the higher density elements, and that is what these simulated objects represent, without regard to chemical properties and effects.

yes the disks can be formed into rings....every dimensional feature of an accretion is disk is covered if im not mistaking, but im not a scientist so, maybe i missed something.
Directly, it uses these features to form the solar systems:

Code: GLBasic [Select]
                        // SOLAR SYSTEM CONFIGURATION
                        GLOBAL SPLITWAVE                                = FALSE                         // Initial planet formation splits into 2 directions.
                        GLOBAL SPACEWAVEFORM%           = 1                                     // 0 = direct VECTORADD addition, 1 = random VECTORADD addition ()
                        GLOBAL RINGS%                           = 12                                    // Number of rings
                        GLOBAL RADS%                            = 2                                     // # of radial hub arms
                        GLOBAL SPREAD#                          = 12.0                          // additional rad spread random angle on xz plane
                        GLOBAL DIST#                                    = 2000.0                                // RADIUS OF PLANET BELT, PER STEP
                        GLOBAL GAP#                                     = 8000.0                                // Magnitude between each ring
                        GLOBAL G#                                       = 0.000006674                   // Gravitational constant - time, the bigger the constant, the faster time goes. our universe irl is very very slow, constant is tiny and thats a good thing.
                        //PLANET PHYSICS
                        GLOBAL STARSIZE#                                = 1000000000.0          // 0 = normal object >0 = star to form in center, size starts at this size.
                        GLOBAL MaxMASS#                         = 1100000.0                     // RANDOM PLANET MASS MAX START SIZE
                        GLOBAL MinMASS#                         = 1000000.0                     // RANDOM PLANET MASS MIN START SIZE
                        GLOBAL VECTORADD#                       = 0.0                           // addition to SPACEWAVEFORM% angle of fall at initialization, 0 = stable, no variationss regardless of SPACEWAVEFORM%,
                        GLOBAL E#                                       = 120.0                         // solar system initial spin speed
 


Once the system is created and set into motion, its all Master Lord Sir Isaac Newtons Laws of motion in effect.
The algorithms he created and so beautiful, so beautiful they're compatible with computer code.
And to think he designed them 400 years ago without a calculator or computer is mind boggling.


[edit] it also has 3 cams, so far (these so tedious)
1 planet chase cam(not fixed, litteraly chases), 2 star tracking cam, and 3 freemouse cam
Freemouse cam also tracks with star, because it moves sometimes, quickly.
Title: Re: 3d Space Sim
Post by: erico on 2019-Mar-03
Now I just wonder, you are probably dealing with numbers super small and huge, are you keeping it all float?
Title: Re: 3d Space Sim
Post by: bigsofty on 2019-Mar-04
Looks very interesting Hemlos, looking forward to seeing it in motion!  :good:
Title: Re: 3d Space Sim
Post by: MrPlow on 2019-Mar-04
Very cool and nerdy! :)
Title: Re: 3d Space Sim
Post by: Kitty Hello on 2019-Mar-09
Very cool. How do you come up with that kind of ideas?
Title: Re: 3d Space Sim
Post by: Hemlos on 2019-Mar-09
Very cool. How do you come up with that kind of ideas?

I randomly study of math and astrophysics on a regular basis, using GLBasic to visualize some math.
I really wanted to see gravity in action, to see; stars, planets and moons form and take on unique orbits.
When i saw the formula for gravity from Isaac Newtons principia, i figured it could be worked out using a double nested loop.
Also, it has become a great platform for refining my 3d libs for cameras, particle engine, lighting, and sfx, etc etc
Title: Re: 3d Space Sim
Post by: dreamerman on 2019-Apr-22
Just waiting patiently to see this in action, at least in video..  :)