POV-Ray : Newsgroups : povray.binaries.scene-files : UK Flag (Union Jack) : Re: Procedural Stars? Was Re: UK Flag (Union Jack) Server Time
2 Sep 2024 20:19:31 EDT (-0400)
  Re: Procedural Stars? Was Re: UK Flag (Union Jack)  
From: Chris Colefax
Date: 4 Mar 2000 20:30:42
Message: <38c1b8c2@news.povray.org>
Peter Santo <spa### [at] cantorinformatikrwth-aachende> wrote:
> Good link. Mike does the trick with transparency and I don't think it
> can be done any other way. This seems to hold for all patterns that
> contain convex and concave elements.

How about using a few nested pigments, e.g. (no camera or lights necessary):

#macro star_pigment (Points, PointAngle, PigmentMap)
   #local Point1 = pigment {planar
      pigment_map {PigmentMap}
      rotate z*PointAngle/2 rotate x*90}
   #local Point2 = pigment {Point1 scale <1, 1, -1>}

   radial pigment_map {
      [.5/Points Point1]
      #declare C = 1; #while (C <= Points)
         [(C-.5)/Points Point2 rotate y*360*C/Points]
         [C/Points Point2 rotate y*360*C/Points]
         [C/Points Point1 rotate y*360*C/Points]
         [(C+.5)/Points Point1 rotate y*360*C/Points]
      #declare C = C + 1; #end
      [(Points-.5)/Points Point2]
      }
      rotate <-90, 0, 90>
      scale sin(radians(PointAngle/2))
#end

#declare Blue = rgb <0, .5, 1>;
#declare White = rgb 1;

plane {z, 0
   pigment {star_pigment (5, 40,
      pigment_map {[0 Blue] [.01 White] [.2 White] [.21 Blue]}
      )}
   finish {ambient 1 diffuse 0}
   translate z*3}


Post a reply to this message

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