POV-Ray : Newsgroups : povray.general : checkered passed : Re: gradient symmetry (was checkered passed) Server Time
8 Aug 2024 22:15:41 EDT (-0400)
  Re: gradient symmetry (was checkered passed)  
From: Chris Colefax
Date: 17 Nov 2000 02:18:02
Message: <3a14dbaa@news.povray.org>
Rick Mabry <rma### [at] softdiskcom> wrote:
> What is the rationale for this symmetry?
>
> Is there a way to create a gradient function with existing (or 3.5) Povray
> commands that lacks this symmetry? More generally,  is there a nice way to
> apply arbitrary functions for combining things? I'm dimly aware of
> density_file, but that seems pretty extreme (even if it can be used).

I can't speak for the original coder of the gradient function, but I can
tell you that to calculate the pattern an fabs() function is used
(converting negatives to positives), which results in the symmetry.  It also
means that the gradient pattern in POV 3.1 and earlier does not work
properly for axes other than x, y, and z.

One solution, as suggested earlier in this thread by Peter, is to use a
ramp-wave'd marble pattern.  The only other option at the moment is to use a
patched version of POV-Ray, such as MegaPOV.  This would allow you to either
use the reset_children warp after a repeat warp (although the former will
not be available in POV 3.5), or, as Ron mentioned, the pigment pattern,
e.g. (this will work in MegaPOV and should work in 3.5):

#declare pigment_checker3 = pigment {pigment_pattern {
      gradient x
      color_map {[1/3 rgb 0] [1/3 rgb 0.5] [2/3 rgb 0.5] [2/3 rgb 1]}
      scale 3
      warp {repeat x*3} warp {repeat y offset x} repeat {z offset x}
      }

plane {z, 10
   pigment {pigment_checker3 pigment_map {
      [0 Pigment1] [0.5 Pigment2] [1 Pigment3]
   }}

As you can see, this new feature allows much more flexible and powerful
patterning.


Post a reply to this message

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