POV-Ray : Newsgroups : povray.general : Draw a line on the texture Server Time
23 Apr 2024 13:16:06 EDT (-0400)
  Draw a line on the texture (Message 1 to 3 of 3)  
From: bocovp
Subject: Draw a line on the texture
Date: 11 Mar 2016 08:50:01
Message: <web.56e2ccb2e23464f82cfb4b8e0@news.povray.org>
I have defined a simple texture, e.g.:
#declare paper1 = texture {
uv_mapping pigment { color rgb <0.8,0.8,1> }
  normal { leopard 1 turbulence 1.7 scale 0.01 }
}

Now I want to draw a line on top of the texture (say I want black line of
thickness 0.1 from point (u,v) = (0,0) to point (u,v) = (1,1)).
What is the best approach to define such texture?


Post a reply to this message

From: Bald Eagle
Subject: Re: Draw a line on the texture
Date: 11 Mar 2016 14:30:01
Message: <web.56e31cac56c547455e7df57c0@news.povray.org>
"bocovp" <nomail@nomail> wrote:
> I have defined a simple texture, e.g.:
> #declare paper1 = texture {
> uv_mapping pigment { color rgb <0.8,0.8,1> }
>   normal { leopard 1 turbulence 1.7 scale 0.01 }
> }
>
> Now I want to draw a line on top of the texture (say I want black line of
> thickness 0.1 from point (u,v) = (0,0) to point (u,v) = (1,1)).
> What is the best approach to define such texture?

I'd probably use layered textures, if you want to keep the adaptive uv-mapping.

http://www.f-lohmueller.de/pov_tut/tex/tex_890e.htm

Either that, or use a color map or one of the special pigment patterns.
I guess it all depends on the uv-mapped object's shape, and how you want it to
look.


Post a reply to this message

From: Alain
Subject: Re: Draw a line on the texture
Date: 11 Mar 2016 17:09:43
Message: <56e34227@news.povray.org>

> I have defined a simple texture, e.g.:
> #declare paper1 = texture {
> uv_mapping pigment { color rgb <0.8,0.8,1> }
>    normal { leopard 1 turbulence 1.7 scale 0.01 }
> }
>
> Now I want to draw a line on top of the texture (say I want black line of
> thickness 0.1 from point (u,v) = (0,0) to point (u,v) = (1,1)).
> What is the best approach to define such texture?
>
>

The best way would be using layered texture.
Start with the base texture, and follow with the second texture to be 
applyed over it.
The second texture will be mostly transparent.
In your case, the dificulty comes from the fact that the line have a 
finite length. For that, I suggest using the object pattern:
#declare PatternObject = box{0, <sqrt(3), 0.1, 0.1>rotate<-45, 0, 45>}
About the correct orientation.
You should use reorient() to get exactly the direction needed.
The distance between <0,0,0> and <1,1,1> = sqrt(3)

#declare Paper1 = texture{
  uv_mapping pigment { color rgb <0.8,0.8,1> }
  normal { leopard 1 turbulence 1.7 scale 0.01 }
}
texture{
  object{PatternObject
    rgbt 1 // outside the object is transparent
    rgb 0 // inside is black
   }
  }

If you want the line do be as long as possible, then, you can use a 
gradient texture:
texture{
  gradient -1
  color_map{[0.1 rgb 0] [0.1 rgbt 1]}
  }

You may also use the planar or cylindrical pattern if you don't want the 
line to repeat. Those need to be rotated.


Post a reply to this message

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