POV-Ray : Newsgroups : povray.newusers : normals and pigments in a csg : Re: normals and pigments in a csg Server Time
5 Sep 2024 22:19:57 EDT (-0400)
  Re: normals and pigments in a csg  
From: Ken
Date: 18 Jul 1999 19:25:20
Message: <379261CF.C44F720D@pacbell.net>
Daniel Pirch wrote:
> 
> Hi group,
> following problem:
> I want to make an object of a csg to have an individual pigment, but the
> normal pattern of the whole csg (with all translations and rotations).
> here is an (simplified) example of what i mean:
> 
> union{
>   sphere{x,1  pigment{ rgb<0,1,0>} } /* I want this sphere to have the
> parent's bumps AND to be green!!*/
>   sphere{-x,1}
>   pigment{rgb <1,0,0>}
>   normal{bumps scale .1 }
> }
> 
> There are several objects in my csg, and all are translated in a different
> way, so i cannot use a #declared normal pattern.
> 
> I hope someone can help me...
> TIA, Daniel
> 
> --
> Daniel Pirch
> nap### [at] linuxzrztu-berlinde

 If I understand your question correctly what you are looking for is several
objects that have their own pigment and then you want to apply a global normal
pattern to the entire csg'd object. This can be done quite simply using the
following method.

  union {
 sphere { x,1 pigment <1,0,0> }
 sphere {-x,1 pigment <1,1,0> }
 sphere { y,1 pigment <0,1,0> }
 sphere {-y,1 pigment <0,0,1> }
 normal { bumps 1 scale 1     }
        }

In the above operation you apply the normal to the csg constuct as opposed
to one or several of the individual components.

  By the way you can use a declared normal pattern anywhere a normal would
normaly be used. For example:

#declare My_Normal = normal { bumps 1 scale  1 }

  union {
 sphere { x,1 pigment <1,0,0> }
 sphere {-x,1 pigment <1,1,0> }
 sphere { y,1 pigment <0,1,0> }
 sphere {-y,1 pigment <0,0,1> }
 normal { My_Normal           }
        }

  If I have missed your intent please try to describe again what it is you
are looking for.

-- 
Ken Tyler
  
mailto://tylereng@pacbell.net
http://home.pacbell.net/tylereng/links.htm


Post a reply to this message

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