.dll Question Planet Modules

cristiapi

New member
Joined
May 26, 2014
Messages
222
Reaction score
0
Points
0
Location
Ancona
The first thing you should do is to write a function which takes in input a time (MJD, for example) and outputs the x, y and z or l, b and r coordinates of the body for that time (both position and velocity).

Only after you coded that stuff, you can try to write your dll for that body.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,874
Reaction score
2,129
Points
203
Location
between the planets
Erm... maybe we should take a few steps back here... Anroalh12, what exactly do you want to do? why do you want to write a planetary module?

I get the impression that you don't know much about programming in general... And you'll need at least a bit of basic knowledge to start off on when you want to write an Orbiter Module. Maybe there are easier ways to accomplish what you want to do without a module. Or if not, it would be best to start by aquiring a little general programming knowledge before you jump into Orbiter...
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,874
Reaction score
2,129
Points
203
Location
between the planets
Ok, so I assume they are special, non-Kepler orbits. You have previously asked what an Ephemeris is. You'll need to know that, because you'll have to write one. Looking up what it is might be a good start. How good is you math?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,874
Reaction score
2,129
Points
203
Location
between the planets
Great, then understanding an Ephemeris shouldn't be too tough. Next question, what expierience do you have with programming?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,874
Reaction score
2,129
Points
203
Location
between the planets

Ok, then that's the point to start. You don't have to become a pro, but at least familiar with the basics of C++ and general concepts like variables, if-then statements and for loops, types, functions and classes. It's best you look around for some beginner C++ tutorials. Once you know what the things mean I wrote above, and how they look in C++, you'll be able to understand what the code means you posted earlier on.
 

cristiapi

New member
Joined
May 26, 2014
Messages
222
Reaction score
0
Points
0
Location
Ancona
Then how do you think to move the planets?

You need to know something like this:
t= MJD * any_constant
x= 123456 * cos(t)
y= 123456 * sin(t)
z= 123456 * any_function(t)

xv= x', yv= y', zv= z' (the derivative of x, y and z)

The planet will assume those positions wrt its parent body (defined in Sol.cfg).
If you don't know how to calculate those values, you're just wasting your time.
 
Top