Page 1 of 1

How'de they do that?

Posted: 29.04.2003, 17:25
by ShortTermParking
Howdy,

I was interested to find out, does anyone know how the "cel" engine works for getting from something so large (a galaxy as a whole, for example), all the way down to something like a single rock so smoothly, etc? I tried picking through the source code, but at this stage in the game, it is a bit too complex for me to know exactly what the programmers where trying to do... If anyone could explain to me the algorithm/theory/whatever on how it works, that would be cool.

Thanx in advance,
--Me

Posted: 30.04.2003, 02:08
by Paul
The key is to represent the position of the camera (viewer's eye) in a custom co-ordinate system that uses VERY high precision numbers (I think in the Celestia source code they are called "BigFix"). This allows the camera to be positioned accurately anywhere within the known Universe with high accuracy (I forget how accurate, but it's easy to calculate of you know the size of a BigFix integer).
Then, all renderable objects are kept in their own co-ordinate space, each of which has a scale independent of each other, but the important thing is that the camera's BigFix co-ordinates can be converted into each local co-ordinate space to render each particular model.
This sort of separate-spaces trick is used a lot in computer games when they want to have things that are basically very far away, like a sun-glare or a sky backdrop. Then again, some games do it the dumb way... :wink:

Cheers,
Paul

Posted: 30.04.2003, 13:57
by Guest
That makes sense. Thanx alot! :D