|
|
Heres a bit of shingles code for you, new and improoved!
#include "colors.inc"
#include "textures.inc"
#include "functions.inc"
#include "shapes.inc"
#include "woods.inc"
camera { location <10,0,-40> look_at <10,0,0> }
background { Blue }
light_source { <900, 560, -500> color White }
light_source { <-900, -560, -500> color White }
light_source { <900, 560, 500> color White }
light_source { <-900, -560, 500> color White }
#declare rStream = seed(0);
#macro
RowOfShingles(heightOfShingle,widthOfShingle,depthOfShingle,lengthOfRow,theT
exture)
#declare currentLength = 0;
#declare gapBetweenShingles = 0.1;
union {
#while(currentLength < lengthOfRow)
#declare thisShingleWidth = widthOfShingle +
(rand(rStream)*(widthOfShingle/2));
box {
<currentLength,0,0>,
<currentLength+thisShingleWidth,heightOfShingle
+rand(rStream),depthOfShingle>
texture {
theTexture
rotate
<rand(rStream)*360,rand(rStream)*360,rand(rStream)*360>
}
}
#declare currentLength = currentLength +
thisShingleWidth + gapBetweenShingles;
#end
}
#end
#macro
Rows(heightOfShingle,widthOfShingle,depthOfShingle,lengthOfRow,theTexture,Ro
wCount)
#declare myCount = 0;
union {
#while(myCount <= RowCount )
object {
RowOfShingles(3,2,0.5,40,theTexture)
translate
<0,(heightOfShingle/2)*myCount,(depthOfShingle*myCount)*-1>
}
#declare myCount = myCount + 1;
#end
}
#end
#declare myShingles = texture { pigment { P_WoodGrain1A color_map {
M_Wood9A } scale 4} };
object {
Rows(3,2,0.5,60,myShingles,12)
rotate <200,0,0>
translate <-10,20,0>
}
Post a reply to this message
|
|