Page 1 of 1

Nice little soft for Solar System Simulation

Posted: 22.06.2005, 14:36
by ElChristou
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

Posted: 22.06.2005, 19:08
by Christophe
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.

Posted: 22.06.2005, 20:05
by ElChristou
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

Fixed foreground orbit problem

Posted: 26.06.2005, 22:28
by doctorjoe
I think I've fixed the problem with lines not appearing in front of the body whose orbit is being rendered.

Posted: 26.06.2005, 23:22
by BlindedByTheLight
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

Posted: 27.06.2005, 02:17
by ElChristou
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

Re: Fixed foreground orbit problem

Posted: 27.06.2005, 02:20
by ElChristou
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

Why this was a hard problem.

Posted: 27.06.2005, 04:55
by doctorjoe
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.