POV-Ray : Newsgroups : povray.newusers : Sub-Routines : Re: Sub-Routines Server Time
5 Sep 2024 02:18:59 EDT (-0400)
  Re: Sub-Routines  
From: Warp
Date: 29 Nov 2001 16:05:02
Message: <3c06a2fd@news.povray.org>
Martin <mar### [at] radiok2rde> wrote:
: I need to draw some csg-union-objects a lot of times in different places
: in my povray-script. Whats the best way to do it? Functions? Macros? Any
: other thing I just didn't see?

  This could perhaps be called "advanced feature blindness". That is, people
only see highly advanced features and are blind to the simplest control
structures.
  You just make an identifier from your union:

#declare MyUnion =
  union
  { whatever
  }

  Then you can make copies of that:

object { MyUnion translate <1,2,3> }
object { MyUnion translate <-3,-2,-1> }
and so on.

  If you want to place them in a regular pattern (eg a straight line), you
can use a #while-loop.

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


Post a reply to this message

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