POV-Ray : Newsgroups : povray.general : Trying to create a border line using gradient Server Time
27 Dec 2024 14:08:37 EST (-0500)
  Trying to create a border line using gradient (Message 1 to 2 of 2)  
From: Fernando Souza
Subject: Trying to create a border line using gradient
Date: 3 Mar 2015 22:05:01
Message: <web.54f6756c28f40dba8762ec0@news.povray.org>
Hi everyone,

I'm trying the apply a border line look like in both vertical and horizontal
border of a square:


#declare black = texture {
     pigment {color rgb <0,0,0> }
}

#declare Cor1_1 = texture {
   uv_mapping pigment { image_map { jpeg
"C:\ARQUIV~2\VBFILE~1\PR6DB9~1\Comum\Maps\BRANCO10.JPG" }}
   finish {phong 0 brilliance .3
   }
}

#declare Cor1x = texture {
     gradient x
     texture_map {
         [0.00 black]
         [3.003003E-02 Cor1_1]
     }
     scale 333
}

#declare Cor1 = texture {
     gradient y
     texture_map {
         [0.00 black]
         [3.003003E-02 Cor1x]
     }
     scale 333
}



Then I apply the Cor1 texture to my mesh, but it turns completely black.
But when I apply the Cor1x instead, it works, but of course, it only shows the
horizontal line.

My goal is to draw a line on the four borders, over a image_map.

Is it possible? My approach is right?

Thanks!


Post a reply to this message

From: Le Forgeron
Subject: Re: Trying to create a border line using gradient
Date: 4 Mar 2015 02:28:59
Message: <54f6b43b$1@news.povray.org>
Le 04/03/2015 04:01, Fernando Souza a écrit :
> Hi everyone,
> 
> I'm trying the apply a border line look like in both vertical and horizontal
> border of a square:
> 
> 
> #declare black = texture {
>      pigment {color rgb <0,0,0> }
> }
> 
> #declare Cor1_1 = texture {
>    uv_mapping pigment { image_map { jpeg
> "C:\ARQUIV~2\VBFILE~1\PR6DB9~1\Comum\Maps\BRANCO10.JPG" }}
>    finish {phong 0 brilliance .3
>    }
> }
> 
> #declare Cor1x = texture {
>      gradient x
>      texture_map {
>          [0.00 black]
>          [3.003003E-02 Cor1_1]
>      }
>      scale 333
> }
> 
> #declare Cor1 = texture {
>      gradient y
>      texture_map {
>          [0.00 black]
>          [3.003003E-02 Cor1x]
>      }
>      scale 333
> }
> 
> 
> 
> Then I apply the Cor1 texture to my mesh, but it turns completely black.
> But when I apply the Cor1x instead, it works, but of course, it only shows the
> horizontal line.
> 
> My goal is to draw a line on the four borders, over a image_map.
> 
> Is it possible? My approach is right?

Possible: I would use the boxed pattern instead of gradient.
For image_map, it would need to be scaled and translated, as image_map
is <0,0>-<1,1> and boxed is <-1,-1,-1> - <1,1,1> for the interesting
part (with <0,0,0> being at value 1 )

#declare black = texture {
     pigment {color rgb <0,0,0> }
}

#declare Cor1_1 = texture {
   pigment { image_map { jpeg
"C:\ARQUIV~2\VBFILE~1\PR6DB9~1\Comum\Maps\BRANCO10.JPG" }}
   finish {phong 0 brilliance .3
   }
   scale 2
   translate -1
}

#declare Boxing = texture {
     boxed
     texture_map {
         [0.00 black] // 5% bevel
         [0.05 Cor1_1]
     }
     translate 1
     scale 1/2
}

Right: as long as it works, it must be right. The above code is not tested.

If you want a hard black line, you need to move 0.00 Black to 0.05 Black
(or add 0.05 Black between the two entries).
So far, it's black at 0 and a mixed of the picture with black as the
line get away from the border.

Notice that I removed the uv_mapping statement, as it would make sense
for the top level texture when applied on mesh, but probably not deep in
the tree of texture.

-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

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