POV-Ray : Newsgroups : povray.newusers : normals and pigments in a csg Server Time
6 Sep 2024 00:22:46 EDT (-0400)
  normals and pigments in a csg (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Daniel Pirch
Subject: normals and pigments in a csg
Date: 18 Jul 1999 16:58:00
Message: <37923fd8@news.povray.org>
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


Post a reply to this message

From: Ken
Subject: Re: normals and pigments in a csg
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

From: Remco de Korte
Subject: Re: normals and pigments in a csg
Date: 18 Jul 1999 21:12:15
Message: <37927AE8.471D541C@xs4all.nl>
Ken wrote:
> 
> Daniel Pirch wrote:
> >
> 
>  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     }
>         }
> 
I'm sorry but this won't work (or I am getting real perception problems).
I've had this problem more then once. If you stick a pigment on a part of a csg
(or blob) the normal or finish you use for the whole object doesn't apply there.

Remco
http://www.xs4all.nl/~remcodek/softmach.html


Post a reply to this message

From: Ken
Subject: Re: normals and pigments in a csg
Date: 18 Jul 1999 22:15:50
Message: <379289BF.67095D68@pacbell.net>
Remco de Korte wrote:

> I'm sorry but this won't work (or I am getting real perception problems).
> I've had this problem more then once. If you stick a pigment on a part of a csg
> (or blob) the normal or finish you use for the whole object doesn't apply there.
> 
> Remco
> http://www.xs4all.nl/~remcodek/softmach.html

Then what is the solution ? Should we just use softext instead and forget
about normals and them other pesky primitives ?

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


Post a reply to this message

From: Ken
Subject: Re: normals and pigments in a csg
Date: 18 Jul 1999 22:50:15
Message: <379291CD.8C1026CE@pacbell.net>
Remco de Korte wrote:

> I'm sorry but this won't work (or I am getting real perception problems).
> I've had this problem more then once. If you stick a pigment on a part of a csg
> (or blob) the normal or finish you use for the whole object doesn't apply there.

If at first you don't succeed... you use the other workable solution. This
following example clearly shows that you can maintain even distribution of
a normal pattern for each object in the csg operation and it looks kool too !

  camera {location<0,0,-5>look_at 0}
  light_source {<0,0,-20> rgb 1}

  #declare Norm = normal { gradient x+y 1 rotate 45*x+y scale .5 frequency 2}

  union {
 sphere { 0, 1 pigment { rgb<1,0,0> } translate<-1, 0,0>normal {Norm} }
 sphere { 0, 1 pigment { rgb<1,1,0> } translate< 1, 0,0>normal {Norm} }
 sphere { 0, 1 pigment { rgb<0,1,0> } translate< 0,-1,0>normal {Norm} }
 sphere { 0, 1 pigment { rgb<0,0,1> } translate< 0, 1,0>normal {Norm} }
        }

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


Post a reply to this message

From: Daniel Pirch
Subject: Re: normals and pigments in a csg
Date: 19 Jul 1999 03:30:21
Message: <3792d40d@news.povray.org>
But if the objects are part of other transplated CSGs?

#declare spheres = union{
  sphere{ -2*x, 1 pigment{ rgb<1,0,0>}}
  sphere{0, 1 pigment{rgb <0,1,0>}}
  sphere{ 2*x,1 pigment{ rgb<0,0,1>}}
}
union{
  object{spheres translate 2*z}
  object{spheres}
  object{spheres translate -2*z}
  normal{Norm}
}

Ken <tyl### [at] pacbellnet> wrote in message
news:379291CD.8C1026CE@pacbell.net...
>
>
> Remco de Korte wrote:
>
> > I'm sorry but this won't work (or I am getting real perception
problems).
> > I've had this problem more then once. If you stick a pigment on a part
of a csg
> > (or blob) the normal or finish you use for the whole object doesn't
apply there.
>
> If at first you don't succeed... you use the other workable solution. This
> following example clearly shows that you can maintain even distribution of
> a normal pattern for each object in the csg operation and it looks kool
too !
>
>   camera {location<0,0,-5>look_at 0}
>   light_source {<0,0,-20> rgb 1}
>
>   #declare Norm = normal { gradient x+y 1 rotate 45*x+y scale .5 frequency
2}
>
>   union {
>  sphere { 0, 1 pigment { rgb<1,0,0> } translate<-1, 0,0>normal {Norm} }
>  sphere { 0, 1 pigment { rgb<1,1,0> } translate< 1, 0,0>normal {Norm} }
>  sphere { 0, 1 pigment { rgb<0,1,0> } translate< 0,-1,0>normal {Norm} }
>  sphere { 0, 1 pigment { rgb<0,0,1> } translate< 0, 1,0>normal {Norm} }
>         }
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net
> http://home.pacbell.net/tylereng/links.htm

--
Daniel Pirch
nap### [at] linuxzrztu-berlinde


Post a reply to this message

From: Ken
Subject: Re: normals and pigments in a csg
Date: 19 Jul 1999 04:43:36
Message: <3792E49D.4D782757@pacbell.net>
Daniel Pirch wrote:
> But if the objects are part of other transplated CSGs ?

 Then you end up giving Ken a big pain in his head :(

 If I come up with anything I will get back to you.

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


Post a reply to this message

From: Remco de Korte
Subject: Re: normals and pigments in a csg
Date: 19 Jul 1999 05:38:14
Message: <3792F101.885CB699@xs4all.nl>
Ken wrote:
> 
> Remco de Korte wrote:
> 
> > I'm sorry but this won't work (or I am getting real perception problems).
> > I've had this problem more then once. If you stick a pigment on a part of a csg
> > (or blob) the normal or finish you use for the whole object doesn't apply there.
> >
> > Remco
> > http://www.xs4all.nl/~remcodek/softmach.html
> 
> Then what is the solution ? 

The thing I do is to put the normals and finishes at the same place the pigments
are declared. Too bad, because it needs a little work and perhaps a lot (extra)
memory.

Should we just use softext instead and forget
> about normals and them other pesky primitives ?
I don't see how this relates to the problem here? If you don't want me to bring
it up anymore I won't.

Bye,

Remco


Post a reply to this message

From: Ken
Subject: Re: normals and pigments in a csg
Date: 19 Jul 1999 05:54:29
Message: <3792F53B.25A461CD@pacbell.net>
Remco de Korte wrote:

>> Should we just use softext instead and forget
> > about normals and them other pesky primitives ?
> I don't see how this relates to the problem here? If you don't want me to bring
> it up anymore I won't.

  Easy there Remco. I simply forgot to add the :) to the end of that last
comment. You can plug your useful utility as much as you see fit and it
will not bother me in the least.

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


Post a reply to this message

From: Remco de Korte
Subject: Re: normals and pigments in a csg
Date: 19 Jul 1999 06:34:59
Message: <3792FF4C.395924A3@xs4all.nl>
Ken wrote:
> 
>   Easy there Remco. I simply forgot to add the :) to the end of that last
> comment. You can plug your useful utility as much as you see fit and it
> will not bother me in the least.
> 
I'm a bit (over-)sensitive about it since the first time I brought it up I was
criticized over it being just a windows-program, while I just wanted to share a
sorry utility I developed for my own use (hence no docs and stuff and only a
modest registration-fee ;-))

Remco


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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