POV-Ray : Newsgroups : povray.binaries.images : Dairy Barn (WIP) (27K and 35K) : Re: Dairy Barn (WIP) (27K and 35K) Server Time
11 Aug 2024 11:17:09 EDT (-0400)
  Re: Dairy Barn (WIP) (27K and 35K)  
From: Felbrigg
Date: 25 Mar 2004 05:37:34
Message: <4062b66e@news.povray.org>
Heres a little macro that should give you a head start.  Obviously the
shingle colors are random and you'll want to stick a proper texture in
there.  Also I havn't changed the height of each shingles only the width.

#include "colors.inc"
#include "textures.inc"
#include "functions.inc"
#include "shapes.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)

        #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,depthOfShingle>
                                texture {
                                        pigment {
                                                rgb
<rand(rStream),rand(rStream),rand(rStream)>
                                                }
                                        }
                                }
                        #declare currentLength = currentLength +
thisShingleWidth + gapBetweenShingles;

                #end
                }
#end

object  {
        RowOfShingles(3,2,0.5,40)
        }


Post a reply to this message

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