Malenfant wrote:One more thing I just remembered: a more efficient way to render asteroids. It'd be nice to be able to show all 200,000 or so asteroids that are known but right now doing that using a huge ssc file grinds Celestia to a halt.
Efficiently rendering 200,000 asteroids is a tougher problem than rendering stars. Most stars in Celestia don't move at all, and the ones that do move are confined to orbits that are very small relative to the average distance between stars. These characteristics make the octree an effective structure for fast O(log N) culling of stars that aren't visible.
A conventional spatial subdivision octree is poorly suited for culling solar system object. Right now, Celestia computes from orbital parameters the position of every single object in a solar system. There's a fair amount of computation even for simple Keplerian orbits. We could add some simpler tests to check whether we need to bother with calculating the orbit. Checking the distance of the camera from the orbital plane is very fast and would allow avoiding orbit calculations for most asteroids. An additional test could check the projected position in the orbital plane against the aphelion and perihelion distances. Still, neither of these extra checks really solve the problem--we're still stucking checking every single object in the solar system. It might be possible to use an octree (or some other subdivision method) to efficiently search some sort of orbit parameter space for potentially visible objects.
If you want to display markers or labels or some other indicator for all the asteroids, you're pretty much stuck doing all the orbital calculations. Is this what you're interested in doing?
Malenfant wrote:If Fridger can import thousands of galaxies and binaries in to Celestia there must surely be a way to import the asteroids too, maybe as a binary-format file?
It's easy to get the data from the Minor Planet Center. If you want all 200,000 asteroids, a binary version of the ssc format is quite important. The memory footprint of the object that Celestia uses for a solar system body might be too large for such a massive catalog though.
--Chris