POV-Ray : Newsgroups : povray.general : Too many layers? : Re: Solution Server Time
12 Aug 2024 11:20:09 EDT (-0400)
  Re: Solution  
From: Ron Parker
Date: 18 Feb 1999 12:10:24
Message: <36cc4980.0@news.povray.org>
On Wed, 17 Feb 1999 23:46:11 -0500, Anthony Bennett wrote:
>I tried your solution Mr. Parker, but warp only seems to work with pigment
>and not texture, which is what I am using for the stars. I have included the
>code I'm using to make stars, if you find that I'm doing it the stupid way,
>please let me know.

Yours worked when I tried putting the warps inside the pigments on each of
the layers, but I have what I think is a better solution, with no layers
and no playing with fire in the form of oversaturated color values.

You might want to translate and/or scale appropriately; for reference, one
of the stars is always centered at <0,0,0>.  

StarRadius is the radius of the circle drawn through the points on the star.  
XRepeat is the space between adjacent stars on a row.  YRepeat is the space 
between rows.  Make sure that your star will fit in the space you've 
allocated for it; rows may not overlap.  Enjoy!

//-------------------- BEGIN POV CODE
#declare StarRadius = 0.25;
#declare XRepeat = 1.0;
#declare YRepeat = 0.5;
                           
#declare Starpoint = pigment {
  radial 
  color_map {
    [.45 rgbt 1]
    [.45 rgb  1]
    [.55 rgb  1]
    [.55 rgbt 1]
  }      
  translate StarRadius*x
}
  
#declare Whitestar = pigment {
  radial
  pigment_map {
    [.1 Starpoint rotate 72*0*y ]
    [.1 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*0*y ]
  }     
  rotate <90,0,90>
  translate <XRepeat/2,YRepeat/2,0>
  warp {repeat XRepeat*x}
  warp {repeat YRepeat*y offset XRepeat/2*x} 
  translate -<XRepeat/2,YRepeat/2,0>
}
//-------------------- END POV CODE


Post a reply to this message

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