POV-Ray : Newsgroups : povray.binaries.images : Dairy Barn(Take 2) (88k and 118k) : Re: Dairy Barn(Take 2) (88k and 118k) Server Time
14 Nov 2024 04:29:10 EST (-0500)
  Re: Dairy Barn(Take 2) (88k and 118k)  
From: Felbrigg
Date: 29 Mar 2004 09:34:54
Message: <4068340e$1@news.povray.org>
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

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