|
|
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'
|
|