POV-Ray : Newsgroups : povray.newusers : adding 2 pigments : adding 2 pigments Server Time
5 Sep 2024 04:18:04 EDT (-0400)
  adding 2 pigments  
From: Elias Pschernig
Date: 11 Oct 2001 17:00:49
Message: <3bc60881@news.povray.org>
Is there a way to add 2 pigments together into a new pigment? Something like
"average", but only adding the values, without dividing afterwards. I tried
all sort of things, even splitting both pigments into different color
channel functions, adding the functions, and then combining them again into
the new pigment.. but it's quite complicated and messy, only for such a
simple thing. I think there must be a simpler solution and I'm just not
seeing it.

For example, I have one pigment which is <0,0,0> everywhere and has a stripe
of <1,0,0> somewhere, and another pigment which also is black and has
another red stripe. The resulting pigment should be black as well, but have
both stripes. If I use average, it has both stripes, but they get very
dark. I must be overlooking something..

Right now I have this, which does not what I want:

#declare Pigment3 = pigment {
   average
   pigment_map {
      [1 Pigment1]
      [1 Pigment2]
   }
}

Any ideas?

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

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