|
|
worldbuilder wrote:
> I'm trying to make a star object whose radius changes based on
> spectral class and subtype. For example, I want an M9 star to have
> about 0.2 for a radius and a G2 star to have about 1. I can already
> make it change based on subtype but I want to also take into account
> the spectral type. Is there any way to do this?
I think you'd save yourself some trouble if you separate the
spectral class id from the spectral class color:
#declare O = 0;
#declare B = 1;
#declare A = 2;
#declare F = 3;
#declare G = 4;
#declare K = 5;
#declare M = 6;
#declare SPECTRAL_COLORS = array[7]
{
rgb <0.6,0.8,0.95>,
rgb <0.7,0.75,0.9>,
...
}
...
#declare SpectralClass = G;
#declare SpectralColor = SPECTRAL_COLORS[SpectralClass];
Then you can more easily make calculations based on SpectralClass.
You might also wish to have a look at the "lightsys" macros
that provide, among other things, a macro to calculate emission
color based on blackbody temperature.
Post a reply to this message
|
|