POV-Ray : Newsgroups : povray.newusers : Several textures/pigments on one surface : Re: Several textures/pigments on one surface Server Time
5 Oct 2024 15:45:43 EDT (-0400)
  Re: Several textures/pigments on one surface  
From: Mike Williams
Date: 13 Oct 2009 04:55:05
Message: <l0iLTvNm9D1KFwsw@econym.demon.co.uk>
Wasn't it Jovian Ghost who wrote:
>I've got a surface that I'd like to add multiple textures and/or pigments onto.
>Is there a way I can constrict where a pigment/texture appears?
>
>For example, I've got a cylinder, and I'd like a pattern to appear on one cap,
>with another texture appearing within the first one. Is there a way to control
>the boundaries of where the textures go?

For something as simple as a cylinder where you want a specific texture 
on the caps, I'd create the caps as separate objects. So I'd use one 
open cylinder and two discs instead of a single closed cylinder object.

For more complicated situations, I might use a pigment map. The 
difficult bit with pigment maps is specifying where the boundaries of 
the pigments are. You either need to be lucky with the existing POV 
patterns, and have a good understanding of how they work, or need to be 
able to write suitable pattern functions.

#declare p1 = pigment {rgb x}
#declare p2 = pigment {rgb y}

cylinder {-y,y,1
   pigment {
     cylindrical
     pigment_map {
       [0.5 p1]
       [0.5 p2]
     }
     scale 1.99999
   }
}

or

cylinder {-y,y,1
   pigment {
     function {x*x + z*z}
     pigment_map {
       [0.5 p1]
       [0.5 p2]
     }
     scale 1.41421356
   }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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