|
|
Ack, there was a glaring error with the code I posted. Here's a fully-working
version (c:
/*
basalt.pov
2011 Samuel Benge
A quick basalt height map generator. Render with +rng or hf_gray_16
*/
#include "functions.inc"
#include "math.inc"
// user variables
#declare N_Rows = 20; // this determines the number of columns
#declare N_Extra_Columns = 0; // how many columns to randomly add
#declare Jitter = .5; // makes everything a bit more natural
#declare Height_Function = // your height function here
function{
f_ridged_mf(x*3, y*3, z*3, 0.6, 3, 7, 0.7, 0.7, 2)
}
// ~user variables
#default{ finish{ ambient 1 } }
camera{
orthographic
right x*2 up y*2
location -z*10
}
union{
#declare R = seed(1001);
#declare Z = -int(N_Rows*1.4/2);
#while(Z<=int(N_Rows*1.4/2))
#declare X = -int(N_Rows/2);
#while(X<=int(N_Rows/2))
cone{0,0,-y,2/N_Rows
#local Vec =
<
X+odd(Z)/2+rand(R)*Jitter,
0,
Z+rand(R)*Jitter
>/N_Rows*<1,1,sin(pi*2/3)>*2;
#declare XV = Vec.x;
#declare ZV = Vec.z;
translate Vec
pigment{rgb Height_Function(XV,0,ZV).x}
}
#declare X=X+1;
#end
#declare Z=Z+1;
#end
// extra columns
#declare V=0;
#while(V<N_Extra_Columns)
cone{0,0,-y,2/N_Rows
#local Vec = <-1+rand(R)*2, 0, -1+rand(R)*2>;
#declare XV = Vec.x;
#declare ZV = Vec.z;
translate Vec
pigment{rgb Height_Function(XV,0,ZV).x}
}
#declare V=V+1;
#end
rotate x*270
}
// ~basalt.pov
Post a reply to this message
|
|