How'de they do that?

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
ShortTermParking
Posts: 4
Joined: 22.01.2003
With us: 21 years 10 months

How'de they do that?

Post #1by ShortTermParking » 29.04.2003, 17:25

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
It's a shame entire families can be torn apart by something as simple as wild dogs...

Paul
Posts: 152
Joined: 13.02.2002
With us: 22 years 9 months
Location: Melbourne, Australia

Post #2by Paul » 30.04.2003, 02:08

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

Guest

Post #3by Guest » 30.04.2003, 13:57

That makes sense. Thanx alot! :D


Return to “Development”