POV-Ray : Newsgroups : povray.advanced-users : How to change number based on star type? : Re: How to change number based on star type? Server Time
26 Jun 2024 04:21:20 EDT (-0400)
  Re: How to change number based on star type?  
From: Christian Froeschlin
Date: 7 Oct 2011 15:07:32
Message: <4e8f4df4@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.