Nice little soft for Solar System Simulation

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Nice little soft for Solar System Simulation

Post #1by ElChristou » 22.06.2005, 14:36

Hello everybody,

I've just came over a little OpenGL soft not so bad, (also it cannot be compared to Celestia, it's only dedicated to the Solar System), but at least the orbits are well drawn:

Image

I hope one day someone will do something to definitively solve this in Celestia...

For more info: http://www.sssim.com/

Bye
Image

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #2by Christophe » 22.06.2005, 19:08

Joseph Wang provided a patch which fixes this.

Image

This patch and others can be downloaded from here.

Chris hasn't commented on this yet.
Christophe

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

Post #3by ElChristou » 22.06.2005, 20:05

Yes, Tx to Steven I have tested this patch, but unfortunatly it's just a... patch... On my config I still have the planetary orbit "behind" the planet, and the orbits of satelites have a serious problem in close view (lines don't match)...

Image

Bye
Image

doctorjoe
Posts: 76
Joined: 23.05.2005
With us: 19 years 6 months
Location: Austin, Texas

Fixed foreground orbit problem

Post #4by doctorjoe » 26.06.2005, 22:28

I think I've fixed the problem with lines not appearing in front of the body whose orbit is being rendered.

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

Post #5by BlindedByTheLight » 26.06.2005, 23:22

ElChristou wrote:Yes, Tx to Steven I have tested this patch, but unfortunatly it's just a... patch... On my config I still have the planetary orbit "behind" the planet, and the orbits of satelites have a serious problem in close view (lines don't match)...

Image

Bye


Interesting... I hadn't thought of that - no matter what angle I view the orbits, they're always drawn BEHIND the object - as opposed to right down the center. Down the center definitely looks cooler.

Also, if anyone with the knowledge is watching this post - how is that a planet (or body) can FLY in a perfectly computed orbit - but the orbit lines themselves are only rendered with 100 or so points and straight lines between them?

(I'm thining it must have something to do with the fact the planet's aren't actually DISPLAYING the entire orbit at once but not quite sure why...)

Thanks,
S
Steven Binder, Mac OS X 10.4.10

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

Post #6by ElChristou » 27.06.2005, 02:17

BlindedByTheLight wrote:...Also, if anyone with the knowledge is watching this post - how is that a planet (or body) can FLY in a perfectly computed orbit - but the orbit lines themselves are only rendered with 100 or so points and straight lines between them?


As for rings, you can smooth the orbits by adding points in the "celestia.cfg":

OrbitPathSamplePoints 100 (100 is default)

I don't know why orbits are define by points instead of vector, but I suppose there is a good reason...

Bye
Image

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

Re: Fixed foreground orbit problem

Post #7by ElChristou » 27.06.2005, 02:20

doctorjoe wrote:I think I've fixed the problem with lines not appearing in front of the body whose orbit is being rendered.


Good news, Tx for the work.

Bye
Image

doctorjoe
Posts: 76
Joined: 23.05.2005
With us: 19 years 6 months
Location: Austin, Texas

Why this was a hard problem.

Post #8by doctorjoe » 27.06.2005, 04:55

Just to explain why the foreground orbits was a hard problem.

OpenGL has a z-depth buffer that stores information about how close or far something is in order to figure out if someone should be drawn in front or behind something else. The trouble with this depth buffer is that it doesn't have enough accuracy to do this correctly if there is a wide variation in distances, which happens to be the case in celestia where some things could be meters away, and some things could be light years.

So what celestia does is to bypass all of this and use depth buffers to draw an individual object and bypass the system in drawing the relation between objects. It sorts the objects in order of distance and draws them from back to front, with the front objects block the back ones.

The trouble with this is that you then can't render the orbits correctly since the orbits are lines that move back and forth between objects.

What the patch does is to draw the orbits three times. Once for the background. Once to draw then in front of the planet the object is orbiting, and once more to draw the intersection between the orbit and the object. This is less bad than it sounds, before there is some code that removes unnecessary redraws. Also all of the calculations for where the orbits are drawn are only done once.

Also the software that started this thread "cheats." The planets they draw are huge, and so they can put everything into one depth buffer without accuracy problems. Pretty, but wrong.

Also, as far as the "hole in the sky" bug. That is because the code that draws the clouds doesn't know anything about oblateness.


Return to “Development”