|
|
"Samuel Benge" <stb### [at] hotmailcom> wrote:
> It's really only good for line thicknesses between 1-2 pixels, but at least the
> lines are of an even width. Antialiasing is recommended. Hope it helps!
Here's a version using an improved method. Elevation lines of any thickness will
be drawn properly, at the expense of PPS:
#declare NLines = 10; // number of "elevation" lines
#declare LineSize = 3; // line size in pixels (1.0-?)
#declare LineOffs = 0; // line offset (phase)(0.0-1.0)
#declare LineRes = LineSize*16; // number of line samples (1=?)
// input pigment
#declare PgInput =
pigment{
bumps
turbulence .5
lambda 2.5
}
#declare FInput =
function{
pattern{
pigment_pattern{
PgInput
phase LineOffs/NLines
color_map{
#for(V, 0, NLines)
[V/NLines rgb (mod(V,2)=0)]
[V/NLines+1/NLines rgb (mod(V,2)=0)]
#end
}
}
}
}
#macro SampleLoop()
#for(N, 1, LineRes)
#local C = 1/LineRes*N;
#local R = pow(C*sqrt(N)/pow(LineRes,.5),1/3);
#local Angle = N*137.508;
#local Pt = vrotate(y*R, z*Angle);
#local PtX = Pt.x*LineSizeX;
#local PtY = Pt.y*LineSizeY;
, FInput(x+PtX, y+PtY, 0)
#end
#end
#declare PgElevationLines =
pigment{
#declare LineSizeX = LineSize/image_width;
#declare LineSizeY = LineSize/image_height;
function{
min(1 SampleLoop())*(FInput(x, y, 0)=1)
+
(1-max(0 SampleLoop()))*(FInput(x, y, 0)=0)
}
}
plane{z, 0
pigment{PgElevationLines}
}
Post a reply to this message
|
|