|  |  | Given the recent discussions on creating height_fields from functions, I 
thought I'd mention a documented feature of POV-Ray I've not seen 
discussed on these newsgroup fora - that I recall.
It's possible to create an internal image_map from a function on the fly 
in SDL. The syntax is similar to defining a height_field (HF) with a 
function on the fly. The function (or pattern via a function) runs only 
during parsing. The rendering phase then references the internal 
image_map.
For example:
...
#declare Fn02 = function {
     pattern {
         radial sine_wave frequency 16
         translate (x+z)*0.5
         rotate x*-90
     }
}
#macro ImageMap01(_HF)
   #if (_HF=0)
     image_map { function 40, 40 { Fn02(x,y,z) }
   #else
     function 40, 40 { Fn02(x,y,z) }
   #end
   #if (_HF=0)
       map_type 0
       once
     //interpolate 2
     }
     warp { repeat x flip x }
     warp { repeat y flip y }
   #end
#end
#declare Pigment01 = pigment { ImageMap01(0) }
#declare Texture01 = texture { pigment { Pigment01 } }
#declare Box01 = box { 0,<2,2,0.1> }
#declare Obj01 = object {
     Box01
     texture { Texture01 }
     translate <-1.0,-1.0,0>
}
...
Bill P.
Post a reply to this message
 Attachments:
 Download 'fntointernalimage.jpg' (71 KB)
 
 
 Preview of image 'fntointernalimage.jpg'
  
 |  | 
|  |  | > It's possible to create an internal image_map from a function on the fly
> in SDL.
It works, thanks, so many possibility in POV !
It seams to me that this feature will be good for function's graph
representation, as it's possible to use original function as path of function
for colormap.
I will play with it this evening.
--
YB
 Post a reply to this message
 |  | 
|  |  | William F Pokorny <ano### [at] anonymous org> wrote:
> Given the recent discussions on creating height_fields from functions, I
> thought I'd mention a documented feature of POV-Ray I've not seen
> discussed on these newsgroup fora - that I recall.
I think I asked clipka about it once, but I never got around to doing much with
it, and I can't recall seeing anything that jumped out in the documentation.
Thanks for the code/syntax example.    Those are always most helpful.
- BW Post a reply to this message
 |  |