POV-Ray : Newsgroups : povray.newusers : How to keeping texture after CSG? : Re: How to keeping texture after CSG? Server Time
5 Sep 2024 16:17:47 EDT (-0400)
  Re: How to keeping texture after CSG?  
From: Chris Huff
Date: 24 Jun 2000 16:14:26
Message: <chrishuff-C13BCA.15185324062000@news.povray.org>
In article <3955124b$1@news.povray.org>, "Marc-Hendrik Bremer" 
<Mar### [at] t-onlinede> wrote:

> I want to model a shield for my guard. I want to make it out of 
> wood-planks and intersect it in shape. There is the union of the 
> wood-planks (with individually translated textures) which looses its 
> texture while differenced or intersected with a sphere. As I read, 
> this is totally normal - but annoying.

Just change the order of things a bit...intersect each plank 
individually, texture the resulting intersection objects, and place the 
intersections in the union. In other words, use a union of intersections 
instead of an intersection of a union.
To make things easier, #declare the sphere and use object {sphereName}. 
That way, you don't have to redo every copy of the sphere to make a 
small adjustment. This is also more efficient in some cases, since you 
can choose to only do an intersection/difference on the planks which 
will be affected by it.

Instead of:
intersection {
    union {
        object {Plank texture {...} translate...}
        object {Plank texture {...} translate...}
        object {Plank texture {...} translate...}
        ...
    }
    sphere {...}
}

Do it like this:
#declare MySphere =
sphere {...}

union {
    intersection {
        object {Plank}
        object {MySphere}
        texture {...}
        translate ...
    }
    intersection {
        object {Plank}
        object {MySphere}
        texture {...}
        translate ...
    }
    intersection {
        object {Plank}
        object {MySphere}
        texture {...}
        translate ...
    }
    ...
}

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

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