Page 1 of 1

Large scale renderization

Posted: 06.11.2007, 16:31
by Reginadelletempeste
Hello everyone :)
I'm trying to understand how Celestia works, and I'm a bit stuck on how large scale renderization is handled. In my short career I understood that floating point numbers are not sufficient to render very large scenarios (like the entire universe...) and objects with very different scales (from 1e-6 to 1e20, for example), and I would like to understand how this problem is managed in Celestia.
Can someone explain the algorithm, tell me if there is any documentation, or draw me a scheme? Thank you in advance and keep on the good work! :)

Reginadelletempeste

Posted: 06.11.2007, 18:08
by selden
I don't know the details: you'll have to read the source code on SourceForge.
http://celestia.cvs.sourceforge.net/celestia/celestia/
A somewhat obsolete overview of the program structure is at
http://celestia.cvs.sourceforge.net/cel ... vision=1.6

However, I do know that Celestia uses both128bit arithmetic (quad precision) for placing stars and changes the origin when drawing planetary systems. Even so, it's limited to drawing stars within 16KLY of the Sun.

Posted: 06.11.2007, 18:11
by Paolo
Hi RdT
The magic is done by a custom number type. Browse celestia CVS and search for BigFix class.

http://celestia.cvs.sourceforge.net/cel ... c/celutil/

Posted: 08.11.2007, 13:45
by Reginadelletempeste
Thank you very much :)
What I still cannot understand is: how Celestia convert these BigFix numbers to be used with OpenGL cards (which hardware is in 32 bit precision...) without losing precision?
Thank you again!

Posted: 14.11.2007, 13:46
by manu
Hello everyone!

I'm new of Celestia and I'm trying to survive in this jungle of code :)
I have some questions about the same topic.
I noticed that Celestia uses 128-bit fixed point (64.64) numbers for high-precision celestial coordinates (BigFix, good name for this class :) ).
The class UniversalCoord contains BigFix x,y,z and the struct RigidTransform contains both translation (UniversalCoord) both rotation (Quatd).
Observer.situation is a Rigidtransform which indicates camera position.

Is it right?

These are my questions:

-I can't understand the usage of FrameOfReference
-where does camera position (expressed in 128-bit) is converted in float for rendering?
-I read that "object positions are stored at two different scales--light years for stars, and kilometers for objects within a star system" to avoid using 128-bit. The position of the objects in a star system are expressed respect to the star in the centre of that star system? Where does this positions are converted in a unique reference system for rendering? Does we have multiple rendering steps in different scales? If so, how is managed the different scale between the rendering steps? I mean, if we have a star at 1 light year of distance from the camera and a planet at 1 kilometer from
the camera, why don't they seem in the same position (1 unit from camera in both cases)?

Thank you in advance for everyone will reply.
Bye