POV-Ray : Newsgroups : povray.newusers : Is it possible to layer a texture over a CSG ? : Re: Is it possible to layer a texture over a CSG ? Server Time
30 Jul 2024 16:26:20 EDT (-0400)
  Re: Is it possible to layer a texture over a CSG ?  
From: Mike Williams
Date: 4 Dec 2003 22:52:51
Message: <848sRCAA9$z$EwJU@econym.demon.co.uk>
Wasn't it Bernard Hatt who wrote:
>Mike Williams wrote:
>> 
>> Wasn't it Bernard Hatt who wrote:
>> >
>> >It seems that you can layer a (partly transparent) texture over a single
>> >item, but not a union. Is there some way to do this ?
>> >
>> [...]
>> I'd guess that it's not going to be possible to do what it looks like you want
>> to do. If you want different inner layers on the components of your union, I
>> think you're going to have to write the shared outer layer onto each
>> individual component.
>> 
>> --
>> Mike Williams
>> Gentleman of Leisure
>
>Thanks for the replies,
>
>The problem is that I have an object constructed from a number of wooden
>elements which are rotated/translated into position. If I apply the bozo
>layer onto each element then the pattern doesn't match where the edges
>of the elements meet...

That's not a problem. You can put one texture layer before the
rotation/translation and one texture layer after it. For example:

#declare WOOD = texture {
 T_Wood7 rotate x*90
}

#declare BOZO = texture {
 pigment{bozo 
  scale 0.25 
  color_map {[0.5 rgbf 1][0.5 rgb 1]}}
}

union {
 box{0,<0.5,1,0.5> texture {WOOD} 
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  rotate -z*90
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  translate <1,-0.5,0>
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  rotate -z*90
  translate <0.5,1,0>
  texture {BOZO}
 }
}

The WOOD grain is discontinuous, because it rotates and translates with
each component, but the BOZO layer is continuous because it is applied
after the transformations.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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