POV-Ray : Newsgroups : povray.binaries.images : Dairy Barn (WIP) (27K and 35K) : Re: Dairy Barn (WIP) (27K and 35K) Server Time
11 Aug 2024 17:14:59 EDT (-0400)
  Re: Dairy Barn (WIP) (27K and 35K)  
From: Felbrigg
Date: 29 Mar 2004 09:33:33
Message: <406833bd$1@news.povray.org>
Heres some Shingles Code!  (Me Shingles 'aint 'arf painful guv'.  :-)

#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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.