POV-Ray : Newsgroups : povray.newusers : Colored Shadows? Server Time
4 Nov 2024 23:19:28 EST (-0500)
  Colored Shadows? (Message 1 to 5 of 5)  
From: Hershel Robinson
Subject: Colored Shadows?
Date: 14 Aug 2001 14:49:04
Message: <3b7972a0@news.povray.org>
I hate to monopolize this newsgroup, but no one else is really asking
questions, so here I go again.

As I mentioned, I am trying to make web page buttons as my first POV
project.  I have so far nice-looking buttons, but I want a little more.  I
actually got the idea of using an engraving effect from here:
http://arena.cwnet.com/povdocs/pov51.htm
but I haven't quite gotten what I want.

I can get the letters to appear to be cut out of the button, but when I do
it, I lose the green color of the letters, I presume because most of the
engraved letter is in shadow and so it shows up black.  Do you know how I
can create this engraved effect and yet still retain the full color of the
letters?

Thank you, I appreciate your help,
Hershel

My code (without any fancy color manipulations):

#include "colors.inc"
#include "textures.inc"

#declare Cam3 = camera { location<3.1,2,-7>
                         look_at <3.1,2,0>}
camera{Cam3}

light_source{<-12,15,-15> color White}

blob {
    threshold .65

    cylinder { <0,0  ,0>, <6,0  ,0>, 1, 1 }
    cylinder { <0,.5 ,0>, <6,.5 ,0>, 1, 1 }
    cylinder { <0,1  ,0>, <6,1  ,0>, 1, 1 }

//    pigment { Blue }
   pigment { rgb <0.1 , 0.5, .9>  }
    finish { phong 1 }

    translate .65*z
}

text { ttf "timrom.ttf" "View Pipeline" .1, 0

    pigment { Black}

    translate <0, .20, 0.03>

    finish { diffuse .9 }

     }

plane {<0,0,-1>, -.25
       pigment {color White}
       finish { diffuse 10 }
}


Post a reply to this message

From: Micha Riser
Subject: Re: Colored Shadows?
Date: 14 Aug 2001 15:40:03
Message: <cnubl9.ndj.ln@micha.riser>
Hershel Robinson wrote:
> I can get the letters to appear to be cut out of the button, but when I do
> it, I lose the green color of the letters, I presume because most of the
> engraved letter is in shadow and so it shows up black.  Do you know how I
> can create this engraved effect and yet still retain the full color of the
> letters?

When you want to cut something away, you have to use the 'difference' of 
the both objects. So:

difference{
  A
  B
}

This will cut away object B from object A. The texture the resulting 
objects depends where you put the 'texture' statements. If you put it at 
the end then the whole object has the same texture, if you put it into each 
of the two objects then it will have all over the texture form A except 
where B cuts A.

This kind of operation is called 'CSG'. There is some documentation about 
it (besides the manual of course!) at 
http://www.cs.mtu.edu/~shene/COURSES/cs3621/LAB/povray/csg.html

> My code (without any fancy color manipulations):

Using difference this should look like:

> 
> #include "colors.inc"
> #include "textures.inc"
> 
> #declare Cam3 = camera { location<3.1,2,-7>
>                          look_at <3.1,2,0>}
> camera{Cam3}
> 
> light_source{<-12,15,-15> color White}
> 

difference{

> blob {
>     threshold .65
> 
>     cylinder { <0,0  ,0>, <6,0  ,0>, 1, 1 }
>     cylinder { <0,.5 ,0>, <6,.5 ,0>, 1, 1 }
>     cylinder { <0,1  ,0>, <6,1  ,0>, 1, 1 }
> 
> //    pigment { Blue }
>    pigment { rgb <0.1 , 0.5, .9>  }
>     finish { phong 1 }
> 
>     translate .65*z
> }
> 
> text { ttf "timrom.ttf" "View Pipeline" .1, 0
> 
// >     pigment { Black}

I thought you wanted them green. So you need

  pigment{Green}

> 
>     translate <0, .20, 0.03>
> 
>     finish { diffuse .9 }
> 
>      }

}


> 
> plane {<0,0,-1>, -.25
>        pigment {color White}
>        finish { diffuse 10 }
> }
> 

Note that I have not tested the scene. I hope it works all the same ;)

- Micha

P.S. The pages at www.povworld.de/objects and www.povworld.de/book might be 
interesting for you. The first provides more than 250 source code for 
povray objects, with the second you find a list of tutorials found on the 
web.

-- 
Ceterum censeo Microsoft esse dividendum.


Post a reply to this message

From: Hershel Robinson
Subject: Re: Colored Shadows?
Date: 14 Aug 2001 15:45:33
Message: <3b797fdd@news.povray.org>
> When you want to cut something away, you have to use the 'difference' of
> the both objects. So:

Yes, I realize that, I just forgot to include that part of my code.

> Using difference this should look like:

Your additions are exactly what I have here.

>   pigment{Green}

That, too. :)

> Note that I have not tested the scene. I hope it works all the same ;)

I have tested it and the problem I described in my first letter, with the
shadows being black and not green, is precisely the problem with the scene.

Thanks,
Hershel


Post a reply to this message

From: Micha Riser
Subject: Re: Colored Shadows?
Date: 14 Aug 2001 16:10:06
Message: <ha0cl9.1kj.ln@micha.riser>
Hershel Robinson wrote:
> I have tested it and the problem I described in my first letter, with the
> shadows being black and not green, is precisely the problem with the
> scene.
> 
Okay, I rendered it. It is just that the black area lies in shadow and 
therefore is black. There are various ways to avoid the problem. The 
easiest is probably to use 'ambient' in the finish.

So use
  finish{diffuse 0.3 ambient .7}
for the text's finish. Try some different combination for the two values.

Other possibilities would be:
- change the lighting, so that the cut out is everywhere lit (several light 
sources, aera light)
- make the cutting out less deep
- use radiosity


Micha

-- 
Ceterum censeo Microsoft esse dividendum.


Post a reply to this message

From: Hershel Robinson
Subject: Re: Colored Shadows?
Date: 15 Aug 2001 05:10:55
Message: <3b7a3c9f@news.povray.org>
> So use
>   finish{diffuse 0.3 ambient .7}
> for the text's finish. Try some different combination for the two values.

Thank you.  That did it.

Hershel


Post a reply to this message

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