POV-Ray : Newsgroups : povray.advanced-users : cutaway_textures when not using the default texture : cutaway_textures when not using the default texture Server Time
6 Oct 2024 13:17:20 EDT (-0400)
  cutaway_textures when not using the default texture  
From: clum
Date: 3 Jan 2007 05:20:00
Message: <web.459b82efd67de44323100790@news.povray.org>
I have several objects, each with a different texture, which need to be cut
away with the same CSG cut. I decided to union them together, and
difference that union with this one object. This larger difference, is then
a part of a union of various objects, which has a texture, to give all of
the untextured objects the same texture. (Hold on a second, there'll be a
code sample soon.) When I rendered, I discovered that the cutout was given
the color of the whole union. I did a quick search, and found that I'm
supposed to add the cutaway_textures keyword. However, it still didn't
help! I worked on simpler cases, and found that it was failing because of
the texture in the outer union. I can think of workarounds (i.e. putting
all of the non-textured items in my bigger union into its own union, but
that's not simple because of all of the transformations done on each union,
or to do a difference on each set of objects with the same texture, which
isn't easy because of the number of textures), but I wouldn't mind a
simpler solution.
Reading this over, this was a very unclearly written post, so hopefully this
bit of code will make it clearer:

camera {location <2,5,3> look_at 0}
light_source {<4,5,2> rgb 1}

union {
    difference {
        box {-1, 1 texture{pigment{rgb<0, 1, 1>}}}
        box {0, 2}
        cutaway_textures
    }
    box {<-2, -1, -1>, <-1, 1, 1>}
    texture{pigment{rgb<1, 0, 0>}} // Commenting out this line makes the
cutaway work, but makes the last box disappear
}


Post a reply to this message

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