POV-Ray : Newsgroups : povray.general : Duplicate ? : Re: Duplicate ? Server Time
5 Aug 2024 10:16:55 EDT (-0400)
  Re: Duplicate ?  
From: Warp
Date: 25 Nov 2002 03:13:59
Message: <3de1dbc6@news.povray.org>
Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
> unfourtunetly I need 1000*1000 object { GrassPatch }
> so I wanted to create BigGrassPatch that is a union of 10*10 GrassPatch'es 
> and then duplicate it 100*100 times, but in current yntax it seems 
> impossible without hand transforming each grass pice (as described in post 
> (exacly)...)

  Have you ever heard of #while-loops? They are handy, you know...


#declare GrassPatch = mesh { ... }

#declare Xpos = 0;
#while(Xpos < 100)
  #declare Zpos = 0;
  #while(Zpos < 100)
    object { GrassPatch translate <Xpos, 0, Zpos> }
    #declare Zpos = Zpos+1;
  #end
  #declare Xpos = Xpos+1;
#end

  Magically you get 100*100 instances of the mesh.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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