how would i make it go with the red line?
1.5 ecccentricy and 0 inclination right now
Given the example renderer demo, a timeAcceleration of 1 will be real time.
Letâs look at the heartbeat handler:
-- A handler for the Heartbeat event. The argument step contains the time since the last frame.
function OnHeartbeat(step: number)
currentTime += step * timeAcceleration -- <-- THIS IS THE IMPORTANT LINE
PositionPartBasedOnPrediction(orbit, spacecraftPart, currentTime)
end
Every frame, we run currentTime += step * timeAcceleration
. This says âincrement the current time by the time acceleration times the amount of time that has passed since the previous frame.â If the time acceleration is one, then we increment only by the time that has passed since last frame, e.g. real time.
What you are trying to do here doesnât have much meaning or relevance in astrodynamics, but you might be able to achieve it by adding Ď radians to the inclination.
the weird part is when i put the semi major as -negative,the orbits flip sideways as it the planet is going clockwise(seen from top)
but the spacecraft just doesnt work
See my previous comment on the matter of negative semimajor axis. The library assumes you are giving it values that make physical sense.
For further discussion related to this, please directly message me as we have been inadvertently creating many replies and I would like to keep the forum clean .
Thanks a ton. I got it all working so well. Itâs amazing!
@Creeperman16487 amazing thing that you did with the slider. Really amazing and creative. Nice work!
Dont credit me for the slider,its a module from devforum its called Slider Module,pretty good stuff
The reason i have sliders is because i wanted to see the orbits before adding them in my game
I did see that the sliders was a module. But how you used the sliders to change the orbit right there.
i just changed a replicated storage value with the eccentricity,semi major etc,then i would just redo the whole orbit again by deleting and creating
if your laggy enough you can see the orbit being destroyed and constructed back with the new data
smth like
local orbit = orbitfunctionhere(orbitdatastuffhere)
âwe make the planet orbit and create line
âwe do code here to detect when the replicated storage values change
we do
âdestroy lines of previous orbit
orbit = orbitfunctionhere(orbitdatastuffherewithnewdata
âwe make the planet orbit and create line
i also made a module to shorten the code too
its called OrbitMakers in the game
also i made a triple body system
BestOrbits.rbxl (66.3 KB) (Moon,earth and sun)(can only change earth orbit not moon)
I saw the scripts and knew how it worked. Really cool how you put it all together to make the demo. The OrbitMakers helps a ton especially for newer developers.
I didnt actually make it in the intention to help others,it was just for me,putting all the code from the docs into one server script was just too hard for me to understand so i made that,its a pretty bad module but it works,maybe i could make it better if i had time but nah
anyways this is a pic of the moons orbit being traced,pretty cool ngl(trails btw)
i also made this thing where the earth orbit inclination changes slowly and make an entire turn,its pretty cool how messy the moons orbit gets
Those pics are very cool and interesting.
sorry to revive a dead thread but
this project got me an internship at NASA lol
congratulations
congrats, thats insane. my guy pulled up to nasa and said âlook at my roblox libraryâ and got hired
Itâs just like how someone got an internship at NASA from Kerbal Space Program. Except you put WAY more effort. What department do you serve in NASA? (just curious lol) and what do you do?