POV-Ray : Newsgroups : povray.general : Slope map problem : Re: Slope map problem Server Time
31 Jul 2024 16:25:32 EDT (-0400)
  Re: Slope map problem  
From: Random Pete
Date: 13 Dec 2006 05:55:00
Message: <web.457fdb8f9d3f2d3b4f9f155d0@news.povray.org>
Vaclav Cermak <dis### [at] disnelcom> wrote:
> Hi,
>
>    I'am trying to create "box mapped" texture using slope_map, it looks like
[...]

Try applying the texture *after* the transformation, see if that makes any
difference. I think because the slope map *depends* on surface angles, it
will not necessarily work the way you might expect before/after
transformation:

#declare Obj = box {
   <0, 0, 0>, <1, 1, 1>
   translate <-0.5, -0.5, -0.5>
}

#declare Tex =
   texture {
     ArMa_pBoxMap(<1, 1, 1>, array [6] {
       pigment {color rgb <1, 0, 0>}
       pigment {color rgb <0, 1, 0>}
       pigment {color rgb <0, 0, 1>}
       pigment {color rgb <1, 1, 0>}
       pigment {color rgb <1, 0, 1>}
       pigment {color rgb <0, 1, 1>}
     })
   }

union {
   object {Obj translate <-1.5, 0, 0> texture { Tex } }
   object {Obj rotate <0, 45, 0> texture { Tex } }
   object {Obj rotate <0, 90, 0> translate <1.5, 0, 0> texture { Tex } }
   translate <0, 0.5, 0>
}


.... The other problem could be that (iirc) sometimes the texture of the
first object in a union can override that of other objects, unless they
have their own individual textures defined. Either way the above code
should fix it.

Pete


Post a reply to this message

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