|
|
Brick for some of my posts in the binaries newsgroup. It could easily be
put in one single macro and tidied up a bit, but that's for another
day......
John
#local f_rounded_box = function { internal(60) }
#local rndm = seed(1450977);
/////
#declare Dull =
finish {
ambient 0.1
diffuse 0.8
specular 0.1
roughness 0.005
}
/////
#macro aBrick(Seed,xX,yY,zZ,Round,Gray)
#local nX = xX/2;
#local nY = yY/2;
#local nZ = zZ/2;
#local LightStone =
texture {
pigment {
granite
colour_map {
[0 rgb 0.5+(rand(rndm)*0.5)]
[1 rgb 0.25+(rand(rndm)*0.75)]
}
scale <10,2,10>
}
finish { Dull }
}
#local W1 = function { pigment {wrinkles scale 0.5 translate
<Seed,-Seed,Seed> } }
isosurface {
function { f_rounded_box(x,y,z,Round,nX,nY,nZ) -
W1(x,y,z).gray*Gray }
threshold 0
max_gradient 1.5
accuracy 0.01
contained_by { box
{<-nX-0.125,-nY-0.125,-nZ-0.125>,<nX+0.125,nY+0.125,nZ+0.125>} }
translate <nX,nY,nZ>
texture { LightStone translate <-Seed,Seed,-Seed> }
}
#end
///////////////////
#local stdGray = 0.125;
#local yOffs = 0;
#local xOffs = 0;
#local stdRound = 0.065;
#local BricksHigh = 5;
#local WallWidth = 20;
#local MinWidth = 0.5;
#local MaxWidth = 4;
#local BrickHeight = 1;
union {
#while(yOffs < BricksHigh*BrickHeight)
#local Flag = 1;
#local xOffs = 0;
#while(Flag)
#local xScale = MinWidth+(rand(rndm)*(MaxWidth-MinWidth));
object { aBrick(rand(rndm)*999999,xScale,BrickHeight,1,stdRound,stdGray)
translate <xOffs,yOffs,0>}
#local xOffs = xOffs + xScale;
#if(xOffs + xScale > WallWidth-MinWidth)
object {
aBrick(rand(rndm)*999999,WallWidth-xOffs,BrickHeight,1,stdRound,stdGray)
translate <xOffs,yOffs,0> }
#local Flag = 0;
#end
#end
#local yOffs = yOffs + BrickHeight;
#end
}
///////////////////
light_source { <-50, 25, -55> rgb 1 }
camera {
location <10, 3, -40>
angle 40
right x*image_width/image_height
look_at <10,2,0>
}
background { rgb 0 }
Post a reply to this message
|
|