POV-Ray : Newsgroups : povray.newusers : normals and pigments in a csg Server Time
6 Sep 2024 02:22:58 EDT (-0400)
  normals and pigments in a csg (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
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

From: Chris Colefax
Subject: Re: normals and pigments in a csg
Date: 20 Jul 1999 20:26:41
Message: <379513c1@news.povray.org>
Daniel Pirch wrote:
> 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}
> }

What you wish to do is not possible because specifying a
pigment/normal/finish for an object is actually shorthand for specifying an
entire texture.  In the examples you give above, the pigment statements
apply the default texture to each sphere, with the pigment changed as
desired.  Similarly, the normal applied to the union is shorthand for the
default texture with a changed normal.  CSG textures are only applied to
those child objects that don't have textures specified - and all the spheres
now do, thanks to the pigments.

One possible solution is to predeclare the normal, and apply it to each
object with the pigment.  Or, you can take advantage of the default texture
I mentioned above, by specifying the changed normal *before* declaring the
spheres, eg:

   default {normal {bumps .5}}

This saves typing because you don't need to add it to each object.
Unfortunately, neither method will allow you to transform copies of the
declared object without transforming the texture.  For this, you need to
transform the object, and then apply the texture - perhaps you could use a
macro that creates and places the objects prior to texturing?


Post a reply to this message

From: Peter Popov
Subject: Re: normals and pigments in a csg
Date: 21 Jul 1999 04:09:38
Message: <37957f57.54302713@204.213.191.228>
Have you tried using the #default directive?


Peter Popov
ICQ: 15002700


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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