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:45:59 EDT (-0400)
  Re: How to change number based on star type?  
From: worldbuilder
Date: 8 Oct 2011 12:10:00
Message: <web.4e907516c2ae1aeae743ecc00@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
}
}
}
}
}


Post a reply to this message

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