#version 3.8; global_settings{assumed_gamma 1.0} #default{texture{pigment{rgb .8} finish{ambient .05 emission 0 diffuse .9}}} camera { perspective location <0, .5, -3> look_at <0, .5, 0> right x*image_width/image_height // aspect angle 50 } light_source { 0*x color rgb .3 translate <-200, 400, -200> } light_source { 0*x color rgb .7 translate <200, 400, -200> } background{rgb .15} //---------- // EXAMPLE 1-- a simple way: #declare MY_TXT_1 = text { ttf "timrom.ttf" "colorful" 1, 0 } // an object pattern: #declare OBJ_PATT = pigment { object { MY_TXT_1 color .2*<0,1,1> // could instead be: color transmit 1.0 color rgb <1,.4,0> } // warp{turbulence .3} scale <1,1,1000000> scale <.2,.2,1> translate -.25*x } cylinder{-1.2*y,1.2*y, .5 texture{pigment{OBJ_PATT}} translate -.8*x } //---------------------------------------- // Another more complex way-- but it has a PROBLEM: // The final 'function image_map' is only grayscale, and apparently cannot be colored. #declare MY_TXT_2 = text { ttf "timrom.ttf" "grayscale only" 1, 0 translate <0,0.8,-0.5> } // a function of an object pattern: #declare OBJ_PATT_TO_FUNC = function{ pigment{ object { // actual colors here do not show a colored effect later, only grayscale MY_TXT_2 color rgb 0 color rgb <0,1,0> } scale .16 } } box{<0,0,0>,<1,1,.1> pigment{ // The resulting image_map here is infinite in z, like any typical image_map. image_map{ function 600,600 {OBJ_PATT_TO_FUNC(x,y,z).green} interpolate 2 } scale <1,-1,1> // to mirror-flip the function result-- an old problem. translate <.03,-.55,0> } }