POV-Ray : Newsgroups : povray.general : Blend map error question : Re: Blend map error question Server Time
12 Sep 2024 18:11:34 EDT (-0400)
  Re: Blend map error question  
From: Ron Parker
Date: 25 Jun 2001 10:08:10
Message: <slrn9jeheb.27n.ron.parker@fwi.com>
On Sat, 23 Jun 2001 13:26:16 -0400, Jim Kress wrote:
>Thanks Ron.  Would you please point me to an example of how to nest the
>blend maps?

I would have sworn someone posted something about this here before, but 
none of my searches just now turned up anything useful, so here's a rather
simplistic example.  Of course you could automate this whole process, and
even put the various parts in an array to make the while-loop more manageable.
In this example, each part can consist of up to 255 entries, for a total in
the nested map of 1275 entries.  You could, of course, use up to 255 parts 
for a ridiculous number of entries.  Note that this method will slow down 
rendering, so if your scene already takes a long time to render it won't be 
practical.

#declare Part1=pigment{
  gradient x 
  color_map{
    [0 rgb 0]
    // ... lots and lots of entries ...
    [.2 red 1]
  }
} 
#declare Part2=pigment{
  gradient x 
  color_map{
    [.2 red 1]
    // ... lots and lots of entries ...
    [.4 red 1 green 1]
  }
} 
#declare Part3=pigment{
  gradient x 
  color_map{
    [.4 red 1 green 1]
    // ... lots and lots of entries ...
    [.6 green 1]
  }
} 
#declare Part4=pigment{
  gradient x 
  color_map{
    [.6 green 1]
    // ... lots and lots of entries ...
    [.8 blue 1]
  }
} 
#declare Part5=pigment{
  gradient x 
  color_map{
    [.8 blue 1]
    // ... lots and lots of entries ...
    [1 rgb 0]
  }
} 

#declare Nested=pigment{
  gradient x
  pigment_map{
    [ 0 Part1][.2 Part1]
    [.2 Part2][.4 Part2]
    [.4 Part3][.6 Part3]
    [.6 Part4][.8 Part4]
    [.8 Part5][ 1 Part5]
  }
}

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

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