|
|
Code like this has caused trouble on my machine (Barton XP 3200, 1 GB DDR, Win2k
SP4) under MegaPOV 1.2:
#declare _aspect = image_width/image_height;
#declare _size = 256;
global_settings {
number_of_waves 35
assumed_gamma 1.0
}
camera {
orthographic
location <0,0,-90> // position & direction of view
look_at <0,0,0>
right _aspect*_size*x // horizontal size of view
up _size*y // vertical size of view
}
#debug concat("aspect ratio: ",str(_aspect,1,6),"\n")
#declare wsd = seed(547);
#declare wnm = 9;
#declare pgWave = array[wnm]
#declare ptLiq1 = function { pattern { waves turbulence 0.86 scale 2 } }
#declare ptLiq2 = function { pattern { ripples turbulence 0.41 scale 5 } }
#declare ptLiq3 = function { pattern { crackle turbulence 1.41 omega 0.69 scale
5 } }
#declare ptLiq4 = function { pattern { granite scale 1 } }
#declare ptWave = function { cos(2*pi*(x+clock)) }
#declare ptLiquid = function { pow(ptLiq1(x,y,z),.6)*13.0 -
pow(ptLiq2(x,y,z),1.4)*5.5 }
#macro WaveSet(n,nm)
#local sca = int(rand(wsd)*nm-n)+1;
#local ofp = rand(wsd); // phase offset
#local ofx = rand(wsd)*_size; // x offset
#local ofy = rand(wsd)*_size; // y offset
#declare pgWave[n-1] = function {
pattern {
#switch(mod(n,4))
#case (0)
function {
ptLiq4(pow(cos(1/_size*pi*x),2)+ofx,pow(sin(1/_size*pi*y),2)+ofy,z)*.7 }
#break
#case (1)
function {
ptLiq3(pow(cos(-1/_size*pi*x),2)+ofx,pow(sin(1/_size*pi*y),2)+ofy,z)*.5 }
#break
#case (2)
function {
ptLiq2(pow(cos(1/_size*pi*x),2)+ofx,pow(sin(-1/_size*pi*y),2)+ofy,z)*.3 }
#break
#case (3)
function {
ptLiq1(pow(cos(-1/_size*pi*x),2)+ofx,pow(sin(-1/_size*pi*y),2)+ofy,z)*.1 }
#break
#end
//scale sca
phase ofp
translate <ofx,ofy,0>
}
}
#end
#macro gridWave(nm,sz,fn)
function { (
#local to = nm;
#while (to>0)
WaveSet(to,nm)
pgWave[to-1](x,y,z)
#local to = to - 1;
#if (to>0) + #end
#end
) }
#end
#declare mapLiq1 = color_map {
[ 0.00 rgb <0.000,0.000,0.000> ]
[ 0.03 rgb <0.000,0.076,0.324> ]
[ 0.13 rgb <0.000,0.231,0.479> ]
[ 0.66 rgb <0.118,0.423,0.763> ]
[ 0.80 rgb <0.213,0.459,1.000> ]
[ 1.00 rgb <0.654,1.000,1.000> ]
}
#declare mapLiq2 = color_map {
[ 0.05 rgb <0.000,0.000,0.000> ]
[ 0.08 rgb <0.000,0.076,0.324> ]
[ 0.23 rgb <0.000,0.231,0.479> ]
[ 0.46 rgb <0.118,0.423,0.763> ]
[ 0.70 rgb <0.213,0.459,1.000> ]
[ 0.99 rgb <0.654,1.000,1.000> ]
}
#declare mapLiq3 = color_map {
[ 0.00 rgb <0.000,0.000,0.500> ]
[ 0.90 rgb <0.000,1.000,1.000> ]
[ 1.00 rgb <0.750,1.000,1.000> ]
}
#declare texLiquid = texture {
pigment {
gridWave(wnm,_size,1)
triangle_wave
color_map { mapLiq1 }
phase clock
}
finish {
ambient 1
diffuse 0
}
}
box { -.5,.5 scale _size texture { texLiquid } }
It rarely happens on the first run, but eventually the machine reacts as if it
went into an infinite loop, almost locking up my box until I open Task Manager
and manually end the process (not responding).
--------------
David Wallace
TenArbor Consulting
"Just In Time Cash"
www.tenarbor.com
1-866-572-CASH
Post a reply to this message
|
|