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:43:14 EDT (-0400)
  Re: How to change number based on star type?  
From: Alain
Date: 11 Oct 2011 13:40:23
Message: <4e947f87@news.povray.org>

> I found a better way to make a star. It still doesn't change size based on
> spectral class, but I decided to give up on that part. Instead of using spectral
> classes and subtypes it uses brightness. The colors are still determined by
> spectral types though, which are #defined at the beginning of the file and
> called by each star. Brightness and spectral class are #defined before each
> star. If a star doesn't have the spectral class and brightness defined before
> its definition starts then it's a clone of the star before it.
>
> //These are all the possible star colors
> #declare MStarColor = rgb<0.9,0.4,0.1>;
> #declare KStarColor = rgb<0.9,0.6,0.1>;
> #declare GStarColor = rgb<0.9,0.7,0.1>;
> #declare FStarColor = rgb<0.9,0.7,0.4>;
> #declare AStarColor = rgb<0.7,0.8,0.9>;
> #declare BStarColor = rgb<0.6,0.7,0.9>;
> #declare OStarColor = rgb<0.4,0.5,0.9>;
>
> camera {
>    location<0.0, 2.0, -5.0>
>    look_at<0.0, 0.0,  0.0>
>    right     x*image_width/image_height
> }
>
>
>
> #declare Brightness = 5; //1-5
> #declare StarColor = OStarColor; // MStarColor, KStarColor, GStarColor,
> FStarColor, AStarColor, BStarColor, OStarColor
> #declare StarMedia = (StarColor*2)*(Brightness*2);
> sphere {
> <0,0,0>
> Brightness/2-(Brightness/4)
> hollow
> pigment { rgbt 1 }
> interior { media { emission StarMedia
> absorption rgb Brightness*2
> density { spherical
> warp {
> turbulence 0.01*Brightness
> lambda 4
> omega 0.6
> }
> }
> }
> }
> }
>
>
>

It's probably a beter aproach. Anyway, unless prety close, you only see 
a point whatever the effective star's dimention. What you DO see, is 
it's brightness and colour.

For stars on the main sequance, the dimention follow a continuous path. 
Type O are big and bright, while type M and N are small and dim.

The giants generaly tend to get somewhat bigger from type O to type N. 
Most are type A to M. O stars on the main sequance are only slightly 
smaller than giant O stars.

Most dwarf stars are type F (white dwarf) to N (brown drawf), also of 
roughly equivalent size and smaler than "normal" N types.

A spctral type graph makes a rough mirrored "Z" shape.

For the larger stars, you stand /much/ farther than for the small ones, 
so, it tend to negate the actual size variations.

Do the math...
x/2-x/4 = x/2-(x/4) = (x/2)-(x/4) = x/4
Giving:
Brightness/2 - Brightness/4 = Brightness/4.

For the colour, I propose the use of a spline as follow:
#declare Spl_Class = spline{0, <0.7,0.1,0.03>, 1,MStarColor, 
2,KStarColor, 3,GStarColor, 4,FStarColor, 5,AStarColor, 6,BStarColor, 
7,OStarColor}

And use:
#declare StarColor = Spl_Class(Class);

to set your star's colour. "Class" can take intermediate values. So, for 
a G4 star, you use 3-0.4 or 2.6.


Post a reply to this message

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