|
|
Source for the .pov script mentioned in the 3.5
beta test newsgroup. Can you render this twice in a row
without a crash? (first edit it to use an image that
you actually have in your pov path)
Pete
--
#version 3.5;
/* using newer 3.5 features to read in a color picture and render
it in a scene as a w/w picture
This version uses the grey level as an index into a color
gradient. Can use to this get sepia tones, blueiffied pics,
or just get plain weird
*/
#macro lazy_map(lm_filename)
#local lz_sl = strlen(lm_filename);
#local lz_ext = strlwr(substr(lm_filename, lz_sl - 2, 3)) // get
file type
#if (strcmp(lz_ext, "tga") = 0)
tga lm_filename
#else
#if (strcmp(lz_ext, "png") = 0)
png lm_filename
#else
#if (strcmp(lz_ext, "gif") = 0)
gif lm_filename
#else
#if (strcmp(lz_ext, "iff") = 0)
iff lm_filename
#else
sys lm_filename
#end
#end
#end
#end
#end
#macro rnd_rotate()
rotate <360 * rand(rseed), 360 * rand(rseed), 360 * rand(rseed)>
#end
#macro rnd_translate()
translate <4 - 8 * rand(rseed), 4 - 8 * rand(rseed), 4 - 8 *
rand(rseed)>
#end
#macro perturb()
rnd_translate()
rnd_rotate()
#end
#macro rrand(rlo, rhi)
#local real_lo = min(rlo, rhi);
#local real_hi = max(rlo, rhi);
#local rr_result = real_lo + (rand(rseed) * (real_hi - real_lo));
rr_result
#end
#macro rnd(nn)
#local rnd_result = int(rand(rseed) * nn);
rnd_result
#end
camera {
location 0
direction <0, 0, 3.8>
right <(640 / 480), 0, 0>
up <0, 1, 0>
translate <0, 2, -13>
}
#declare pic_pig = pigment {
image_map {
// lazy_map("test_gilles_pipes.tga")
lazy_map("msqt.bmp")
interpolate 2
}
scale 1.001
}
#declare pic_function = function {
pigment { pic_pig }
}
box { // the piccy as is (color)
<-0.5, -0.5, 0>, <0.5, 0.5, 0>
pigment {
pic_pig
translate <-0.5, -0.5, 0>
}
finish { ambient 0.5 diffuse 0.5 }
scale <640/480, 1, 1>
scale 2.1
translate <0.741, 1.45, 0>
}
box { // the piccy in greyscale
<-0.5, -0.5, 0>, <0.5, 0.5, 0>
pigment {
function {
pic_function(x, y, z).grey
}
color_map {
[ 0.0 color rgb 0 ]
[ 1.0 color rgb 1 ]
}
translate <-0.5, -0.5, 0>
}
finish { ambient 0.5 diffuse 0.5 }
scale <640/480, 1, 1>
translate <-1.48, 3.1, 0>
}
plane { // back wall
<0, 0, -1>, -0.05
pigment { color rgb 1 }
finish { ambient 0.5 diffuse 0.5 }
}
light_source {
<0, 0, -3000>
color rgb 1
area_light <800, 0, 0>, <0, 800, 0>, 5, 5 adaptive 1
rotate x*8
rotate x*30
rotate y*45
}
/* actual end of this file */
Post a reply to this message
|
|