Page 1 of 1

Why are orbits drawn as vectors instead of points?

Posted: 13.07.2005, 23:33
by BlindedByTheLight
Anyone know? Seems weird, expecially considering that bodies themselves orbit the points instead of following the vectors...

Just curious... :)

Posted: 14.07.2005, 00:22
by ElChristou
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?)

Posted: 14.07.2005, 00:48
by BlindedByTheLight
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

Posted: 14.07.2005, 01:28
by hank
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

Posted: 14.07.2005, 01:33
by BlindedByTheLight
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

Posted: 14.07.2005, 01:56
by hank
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

Posted: 14.07.2005, 02:32
by BlindedByTheLight
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

Posted: 14.07.2005, 07:23
by Paolo
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

Posted: 14.07.2005, 07:38
by t00fri

Posted: 14.07.2005, 12:23
by Paolo
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.

Posted: 14.07.2005, 13:12
by ElChristou
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...