Why are orbits drawn as vectors instead of points?

General discussion about Celestia that doesn't fit into other forums.
Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Why are orbits drawn as vectors instead of points?

Post #1by BlindedByTheLight » 13.07.2005, 23:33

Anyone know? Seems weird, expecially considering that bodies themselves orbit the points instead of following the vectors...

Just curious... :)
Steven Binder, Mac OS X 10.4.10

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #2by ElChristou » 14.07.2005, 00:22

Euuh Steve, actually the orbits are drawn with lines between a buck of points... they aren't vectors... (your question seems to be inverted... no?)
Image

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #3by BlindedByTheLight » 14.07.2005, 00:48

LOL... actually my question is coming from a person who apparently doesn't know what a vector is... :)

What I guess I MEANT to ask is why are orbits drawn as lines between a bunch of points? I'm sure it has something to do with the fact that to calculate ALL the points in an orbit (which is huge) would take too much computing power. Yet, as the planets orbit the sun, they are NOT moving in straight lines drawn between a bunch of points, they are moving in a perfectly calculated orbit. How come this isn't possible for orbit lines?

S
Steven Binder, Mac OS X 10.4.10

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #4by hank » 14.07.2005, 01:28

BlindedByTheLight wrote:I'm sure it has something to do with the fact that to calculate ALL the points in an orbit (which is huge) would take too much computing power.

Actually, the number of points in an orbit is more than huge. It's infinite. Calculating ALL the points would take forever, however powerful the computer.

Celestia doesn't need to calculate ALL the points. Only enough for the orbit to appear smooth. But this depends on how closely the observer views the orbit, and at present Celestia generates the orbit points without regard to the view. Otherwise the orbit points would have to be recalculated continuously, which would likely degrade performance significantly.

- Hank

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #5by BlindedByTheLight » 14.07.2005, 01:33

hank wrote:
BlindedByTheLight wrote:I'm sure it has something to do with the fact that to calculate ALL the points in an orbit (which is huge) would take too much computing power.
Actually, the number of points in an orbit is more than huge. It's infinite. Calculating ALL the points would take forever, however powerful the computer.

Celestia doesn't need to calculate ALL the points. Only enough for the orbit to appear smooth. But this depends on how closely the observer views the orbit, and at present Celestia generates the orbit points without regard to the view. Otherwise the orbit points would have to be recalculated continuously, which would likely degrade performance significantly.

- Hank


Thanks Hank. Just curious though... the planets that revolved around the sun... they seem to be following a far more accurate orbital curve than the displayed orbit lines. Why can the planets orbital arc be handled better computatationally but the drawing of the entire orbit not?

Thanks,
S
Steven Binder, Mac OS X 10.4.10

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #6by hank » 14.07.2005, 01:56

BlindedByTheLight wrote:Thanks Hank. Just curious though... the planets that revolved around the sun... they seem to be following a far more accurate orbital curve than the displayed orbit lines. Why can the planets orbital arc be handled better computatationally but the drawing of the entire orbit not?

To display the planet as it moves around the sun, Celestia only has to calculate one point on the orbit for each frame: the position of the planet at the current time. To draw the orbit itself, many points on the orbit must be calculated.

- Hank

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #7by BlindedByTheLight » 14.07.2005, 02:32

Gotcha... makes sense. I guess I just imagined that, since the graphics card was capable of actually drawing the specific pixels of a LINE between two points, it would also be able to draw a common curve like an ellipse between two points. Wouldn't you think? Anyhoo, thanks for the info.

Had a thought though... you had written prior that:

Celestia doesn't need to calculate ALL the points. Only enough for the orbit to appear smooth. But this depends on how closely the observer views the orbit, and at present Celestia generates the orbit points without regard to the view. Otherwise the orbit points would have to be recalculated continuously, which would likely degrade performance significantly.


As of now, it seems that Celestia calculates a default of 100 (or 150 - I can't remember) points to draw an orbit. And you were saying that it would be too "expensive" in processor power for Celestia to dynamically up that number as one got closer to a planet. But what about splitting the difference?

For example, using 150 points to calculate the orbit lines: one hundred points are spread out over the entire orbit to draw the interconnecting lines (creating Line 1, Line 2, Line 3, etc). and the other 50 are focused on whatever particular Line the orbiting body is in at that moment. So if Earth is at Line 50 (between points 49 and 50) that particular line will have 50 extra points.

Thus, as one got closer to Earth, the orbit lines would better match up to the orbiting body.

Sure, as the orbiting body got near to one of the connecting points, it may look a little funky - but any funkier than orbit lines look now when you get close? At least some of the time the orbit lines would like right?

And would dividing up the 150 points this way cost much more (or ANY more) in processor power than just the 150 points spread over the whole orbit?

Thanks,
Steve
Last edited by BlindedByTheLight on 17.07.2005, 00:00, edited 1 time in total.
Steven Binder, Mac OS X 10.4.10

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years 2 months
Location: Pordenone/Italy

Post #8by Paolo » 14.07.2005, 07:23

My two cents

A long time ago I've proposed to use nurbs spline (that are already available in GLU to draw the orbits resampling the points at every frame.
http://www.mevis.de/opengl/gluNurbsCurve.html
Ideally sampling 4 points (knots) per orbit (on the quarters) should be enough in order to draw an elliptical shape. Other 8 points has to be calculated on the tangents of the knots to create the handles (control points) required by the function. The number of intermediate points are calculated by the function and it should be customizable in the cfg file like the xyz paths.
Since this should be computationally expensive it should be advisable to use a switch like this:
Use nurbs orbits for:
- all
- planets, moons and comets
- planets and moons
- planets
- selected body only
- never use always the standard method.
So the user can modulate the total amount of overhead accordingly with the performance of the PC.

Accordingly with the latest issue raised by Steve, this method can implement easily the LOD of the rendered orbit accordingly with the distance of the observer from the body. If necessary it will be sufficient to manage the number of intermediate points.

Kind regards
Remember: Time always flows, it is the most precious thing that we have.
My Celestia - Celui

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #9by t00fri » 14.07.2005, 07:38


Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years 2 months
Location: Pordenone/Italy

Post #10by Paolo » 14.07.2005, 12:23

Thank you Fridger
I remember this thread but it seems that it was finished in the void. Perhaps DoctorJoe that is dealing with the orbits stuff will be interested in making some tests.
Remember: Time always flows, it is the most precious thing that we have.

My Celestia - Celui

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #11by ElChristou » 14.07.2005, 13:12

It's hard to believe that since march 2004 (and earlier?) the problem still the same... I think we really need some new coders to definitively polish the actual state of Celestia...
Image


Return to “Celestia Users”