POV-Ray : Newsgroups : povray.newusers : Newbie - inside/outside colours Server Time
29 Jul 2024 00:25:44 EDT (-0400)
  Newbie - inside/outside colours (Message 1 to 5 of 5)  
From: TheMightyZog
Subject: Newbie - inside/outside colours
Date: 5 Jun 2007 10:00:01
Message: <web.46656b8a194d8e0ff6e04e90@news.povray.org>
Hi,

This is a fantastic program and I'm really enjoying getting to grips with
ray tracing.

I've searched and can't find out how to colour the inside surface
differently from the outside surface of an object.

The following is a U shaped pipe and I would like the inside to be White and
the outside Yellow.  How can I do it?

Thanks
Zog
------------
#include  "colors.inc"
background { color White }

light_source { < -100, 100, -100 > color White}
light_source { <    0,   0, -100 > color Red}
light_source { <  100,   0,    0 > color Blue}

cylinder{
     < -2, 0, 0 >, < 1, 0, 0 >,1
     clipped_by { // open length ways
          box { <-1, 0 ,-1>, <1.1 ,1, 1> inverse }
     }
     clipped_by { // cut off the end
          box { <0.99, -1.1, -1>, <1.1 ,1, 1> inverse }
     }
     pigment { color Yellow
     }
     rotate <-45, 0, 0>
}
sphere{ // this is the colour the inside should be
        <0, -0.1, 0>, 0.2
     pigment { color  White
     }
}

camera {
     location  <3, 3, -3>
     look_at   <0, 0, 0>
}


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Newbie - inside/outside colours
Date: 5 Jun 2007 10:20:01
Message: <web.466570706feb66cec150d4c10@news.povray.org>
"TheMightyZog" <Chr### [at] HotPOPcom> wrote:
> Hi,
>
> This is a fantastic program and I'm really enjoying getting to grips with
> ray tracing.
>
> I've searched and can't find out how to colour the inside surface
> differently from the outside surface of an object.
>
> The following is a U shaped pipe and I would like the inside to be White and
> the outside Yellow.  How can I do it?
>
> Thanks
> Zog
> ------------
> #include  "colors.inc"
> background { color White }
>
> light_source { < -100, 100, -100 > color White}
> light_source { <    0,   0, -100 > color Red}
> light_source { <  100,   0,    0 > color Blue}
>
> cylinder{
>      < -2, 0, 0 >, < 1, 0, 0 >,1
>      clipped_by { // open length ways
>           box { <-1, 0 ,-1>, <1.1 ,1, 1> inverse }
>      }
>      clipped_by { // cut off the end
>           box { <0.99, -1.1, -1>, <1.1 ,1, 1> inverse }
>      }
>      pigment { color Yellow
>      }
>      rotate <-45, 0, 0>
> }
> sphere{ // this is the colour the inside should be
>         <0, -0.1, 0>, 0.2
>      pigment { color  White
>      }
> }
>
> camera {
>      location  <3, 3, -3>
>      look_at   <0, 0, 0>
> }

Have a look at "3.5.9  Interior Texture" for what you are asking for
specifically.

-tgq


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Newbie - inside/outside colours
Date: 5 Jun 2007 10:21:39
Message: <46657173@news.povray.org>
TheMightyZog wrote:

> The following is a U shaped pipe and I would like the inside to be White and
> the outside Yellow.  How can I do it?

Model the geometry both for the inside and the outside (your
pipe is bound to have some physical thickness), and make the
actual object the "difference" of outside - inside. To avoid
numeric problems (coincident surfaces), the "inside" pipe
should a bit longer than the "outside" pipe.

Depending on your geometry, you can often get away with using
a scaled down copy of the outer shape for the inner shape.


Post a reply to this message

From: Stephen
Subject: Re: Newbie - inside/outside colours
Date: 5 Jun 2007 10:50:02
Message: <web.466577246feb66ce726bd13c0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> TheMightyZog wrote:
>
> > The following is a U shaped pipe and I would like the inside to be White and
> > the outside Yellow.  How can I do it?
>
> Model the geometry both for the inside and the outside (your
> pipe is bound to have some physical thickness), and make the
> actual object the "difference" of outside - inside. To avoid
> numeric problems (coincident surfaces), the "inside" pipe
> should a bit longer than the "outside" pipe.
>
> Depending on your geometry, you can often get away with using
> a scaled down copy of the outer shape for the inner shape.

You forgot to say that the outside should have one texture and the object
that you are differencing it with, should have another texture.


Stephen


Post a reply to this message

From: TheMightyZog
Subject: Re: Newbie - inside/outside colours
Date: 5 Jun 2007 12:30:01
Message: <web.46658ec96feb66ceff6e04e90@news.povray.org>
"Stephen" <mcavoys_AT_aolDOT.com> wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> > TheMightyZog wrote:
> >
> > > The following is a U shaped pipe and I would like the inside to be White and
> > > the outside Yellow.  How can I do it?
> >
> > Model the geometry both for the inside and the outside (your
> > pipe is bound to have some physical thickness), and make the
> > actual object the "difference" of outside - inside. To avoid
> > numeric problems (coincident surfaces), the "inside" pipe
> > should a bit longer than the "outside" pipe.
> >
> > Depending on your geometry, you can often get away with using
> > a scaled down copy of the outer shape for the inner shape.
>
> You forgot to say that the outside should have one texture and the object
> that you are differencing it with, should have another texture.
>
>
> Stephen

Thank you all very much - all obvious, I was just searching Google with the
wrong words and forgot about texture - was just thinking of pigment!


Post a reply to this message

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