POV-Ray : Newsgroups : povray.general : color_maps : back to basics : Re: color_maps : back to basics Server Time
18 May 2024 13:27:33 EDT (-0400)
  Re: color_maps : back to basics  
From: Bald Eagle
Date: 16 Apr 2019 20:10:01
Message: <web.5cb66e98e0a4d32d4eec112d0@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:

> I'd like to see your code. If I was going to use it to test a color map I'd put
> it on a plane. Then while testing I could move the pattern around.

Sure thing.
Luckily it was a short file and I can just paste it here.

With regard to viewing the color map with a "linear pattern" - the problem I
always had/have with adjusting some of the patterns is that I want to adjust a
certain _part_ of it, and I don't know which part I'm trying to adjust.  With
wood, for instance, if I want MORE of a certain tone, do I put that in the
center of the color map, or the "ends" at 0 or 1?  Because some of these
patterns don't get distributed proportionally.
So that's why I wanted to plot the numerical values to _see_ what the
distribution was in the pattern itself, not the color map that then gets
re-distributed from the native "linear" definition.



#version 3.7;

/*
 Value mapping of pigment patterns to show map values in 0.1 increments
 Bill Walker "Bald Eagle" April 2018
*/

global_settings {
 assumed_gamma 1.0
}
#include "colors.inc"

sky_sphere {pigment {rgb <1, 1, 1>*0.2}}

camera {
   location <0, 0, -100>    // position & direction of view
  look_at  <0, 0, 0>
  right x*image_width/image_height           // horizontal size of view
  up y // vertical size of view
 }

light_source {<10, 80, 25> color White}

// define textures with numbers from 1 - 10, and use these numbers as textures
in pigment map for wood

#declare Num = array [10];
#for (N, 0, 9)
 #declare Num[N] = text {ttf "arialbd.ttf" chr(48+N) 100, 0 translate <0, 0,
-50>}
#end


#declare T = array [10];
#for (N, 0, 9)
 #declare Current = CHSV2RGB(<N*36, 1, 1>);
 #declare T[N] =
  pigment {
   pigment_pattern {
    object {Num[N]} // 1, 0}
    warp {repeat x}
    warp {repeat y}
   }
   pigment_map {
    [0.0 rgbft Current]
    //[0.9 rgbft Current]
    [1.0 rgb 0]
   }
  scale 0.025
  }

#end

/*
#for (N, 0, 9)
 box {<0.1, 5*N, 0>, <50, 5*(N+1), 0.2>
  texture {T[N]}
 }
#end
*/

#declare NR_wood_grain =
pigment {
  wood
  warp {cylindrical orientation y dist_exp 1}
  warp {turbulence 1.25}
  scale <0.5, 30, 1>
  warp {turbulence 0.25}
  scale <1, 10, 1>
  warp {
   black_hole <0, 0.5, 0>, 1
       falloff 2
       strength 1.5
       repeat 7
       turbulence 2
       inverse
  }
  pigment_map {[0 rgb 0] [1 rgb 1]}
}


#declare NR_Wood =
texture {
  pigment_pattern {NR_wood_grain}
  texture_map {
    #for (N, 0, 0.9, 0.1)
     [N     T[N*10] ]
     [N+0.1 T[N*10] ]
     //#debug concat ( " N = ", str (N, 3, 1),  " N+0.1 = ", str (N+0.1, 3, 1),
" N*10 = ", str (N*10, 3, 1), "\n")
    #end
   }
      triangle_wave

}

box {<-50, -40, 0.1>, <50, 40, 0.2>  //translate -x*25 translate x*B*60
 texture {
  NR_Wood
  scale 60
 }
}

//box {<-25, -25, 0.1>, <25, 25, 0.2> texture {NR_Wood scale 10} }


Post a reply to this message

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