Re: [Celestia-developers] Setting the size of objects in celx.
Real-time 3D visualization of space
Status: Beta
Brought to you by:
cjlaurel
From: vincent <vin...@fr...> - 2007-07-06 09:45:31
|
Chris, Actually, I had read the comment in stardb.cpp, but didn't precisely understand the reason why a better management of the StarDetails class was needed. Now, your explanation makes everything clear. Thanks for taking the time :-) I've checked in the change that adds the setradius method for a solar system body. As an example, the following script maps the [D] key to a function that toggles the size of planets in whatever solar system: http://vincent.gian.club.fr/celestia/planets_toggle_size.celx Actually, this change already allows showing the cycle life of the Sun dynamically. One just has to create a .ssc file to define a new Sun, and make its radius change dynamically within a celx script. @+ Vincent Selon Chris Laurel <cl...@gm...>: > Vincent, > > The change that allows setting the radius of a solar system object > is good, > but there are problems with the code to change star properties. > > In order to keep the size of star objects as small as possible, > star > properties are divided into two categories: properties that are > part of the > Star class, and properties contained in the StarDetails class. The > Star > properties are catalog number, position, and absolute magnitude, > while > everything else is in StarDetails: radius, temperature, shape, > rotation > rate, possibly an orbit. In general, stars with an identical > spectral type > will share the same StarDetails object. For the vast majority of > stars, we > don't have a lot of information beside a position, magnitude, and > spectral > type; they can thus be represented very compactly because all the > StarDetails properties are shared with other stars of that spectral > type. > Yet customization is possible for those few stars where other > information is > known, e.g. the flattened shape of Altair, or the orbits of binary > stars. > > Because the StarDetails object may be shared with other stars, > naively > adjusting the radius of a star is likely to change the radius of > many stars. > And unfortunately, there's no easy way of telling whether star's > details are > shared. Presently, everything is initialized at star creation time; > if a > star's radius, orbit, shape, or other extended info is specified in > an .stc > file, then the star will have it's own details object. There's a > comment in > stardb.cpp mentioning that better management of StarDetails objects > is > needed. Without it, dynamic adjustment of star properties isn't > really > possible. > > Additionally, changing the absolute magnitude of a star potentially > requires > rebuilding the star octree. A star that gets brighter is visible > over a > larger range, and may need to be moved into a larger octree node. > Octree > rebuilding is an expensive operation. It's not reasonable to do it > every > time the absolute magnitude of a star changes. Given these > limitations of > Celestia, I say you should defer your new functions for modifying > stars > until after 1.5.0, but go ahead and check in the function to set > solar > system object radii. > > --Chris |