POV-Ray : Newsgroups : povray.binaries.images : WIP Reflecting Pool/First Binary Post (~110KB) : Re: WIP Reflecting Pool/First Binary Post (~110KB) Server Time
15 Nov 2024 02:26:37 EST (-0500)
  Re: WIP Reflecting Pool/First Binary Post (~110KB)  
From:
Date: 18 Sep 2003 19:12:34
Message: <3f6a3be2$1@news.povray.org>
// > Yea, I got bored of typing in object{MyGrass a whole lot so I just
// > rendered it from where I was at :)
//
// You should learn how to do loops using the #while directive:
// (I'm assuming your ground is the xz-plane)
//
//   Sputnik



#local MyGrass =
  cone { -0.1*y, 0.1, y, 0
    scale <1, 1, 0.2>
    rotate 20*z
    pigment { color rgb <.2, .6, .2> }
    finish { ambient .3 diffuse .7 }
    }

#local XMin = -5;
#local XMax =  5;
#local XStep = 0.4;

#local ZMin = -5;
#local ZMax =  15;
#local ZStep = 0.4;

#local Rand = seed(12345);

#local XCoord = XMin;
#while (XCoord<=XMax)

  #local ZCoord = ZMin;
  #while (ZCoord<=ZMax)

    object { MyGrass
      rotate <20+rand(Rand)*10, rand(Rand)*30, 0> // some random rotation
      translate <XCoord, 0, ZCoord> // transfer to destination
      }

    #local ZCoord = ZCoord+ZStep;
    #end//while ZCoord

  #local XCoord = XCoord+XStep;
  #end//while XCoord


light_source { <-2, 1, -1>*100, color rgb 1 }

camera { location -25*z look_at 0 angle 25 rotate <20, -15, 0> }


Post a reply to this message

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