POV-Ray : Newsgroups : povray.newusers : Blobs functions : Re: Blobs functions Server Time
29 Jul 2024 16:29:43 EDT (-0400)
  Re: Blobs functions  
From: Oleguer Vilella
Date: 23 Jun 2005 03:41:38
Message: <42ba67b2$1@news.povray.org>
Hi Mike,

Yeah, I think I've understood it now.
======================================
pigment {gradient x
pigment_map {[0.2  rgb <0,0,1>]
               [0.4  rgb <0,1,0>]
               [0.6  rgb <1,1,0>]
               [0.8  rgb <1,0,0>]
               [1 color Yellow]}
translate <-0.5,0,0>
scale 0.95*1
translate <0.95/2,0,0>
  }
=======================================
Let more time to practise it. I've also read that documentation and it has 
more information than the other I had read.

Thank you very much for the replys,
Oleguer


"Mike Williams"says:
> > One of the significant things is that you should get rid of the
> "scale 100" if you want more than two bands. I just put that there so
> that you wouldn't see more than two bands unless you made the blob
> extremely large.
>
> Texture_maps work just like colour_maps, so try reading that
> documentation and see if it's any easier.
>
> The basic idea is that "gradient x" sets up a *pattern* that takes the
> value (x - floor(x)) at all points in space. E.g. at the point <0,1,2>
> the pattern takes the value 0, and at <2.45,4,6> it takes the value 0.45
> (that's 2.45 - 2.0). The pattern doesn't care where your object is, it
> only concerns itself with points in space.
>
> So, lets suppose that POVRay is tracing some object and finds a point on
> the surface at <2.45,4,6>, it works out that the value of the pattern is
> 0.45, and looks that up in the texture_map. In your example above, 0.45
> comes exactly half way between these two entries
>   [0.3  pigment {rgb <0,0,1>}]
>   [0.6  pigment {rgb <1,0,0>}]
> so it renders a 50-50 blend of those two textures giving pigment
> {rgb <0.5,0,0.5>}
>
> However, when it finds a point like <3.1,3,3>, the pattern evaluates to
> 0.1 and that's below the first entry in the map, so POV uses the first
> entry in the map.
>
> So for three equally spaced hard-edged bands you might use
>
> pigment {gradient x
>  pigment_map {[1/3  rgb <0,0,1>]
>               [1/3  rgb <0,1,0>]
>               [2/3  rgb <0,1,0>]
>               [2/3  rgb <1,0,0>]}
>  translate <-0.5,0,0>   // move transition point to the origin
>  scale 0.95*2           // scale up the texture_map to show 3 bands
>  translate <0.95/2,0,0> // move the mid point texture to half way along
>                         // the blob
>  }
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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