POV-Ray : Newsgroups : povray.general : while-loop in macro : while-loop in macro Server Time
4 Aug 2024 18:22:12 EDT (-0400)
  while-loop in macro  
From: Lenx
Date: 23 Feb 2003 16:45:18
Message: <web.3e5940689d42b660de2a6cfb0@news.povray.org>
now i'm pulling out my hear on this problem
i just started with this macro to create a fence:


#macro Fence(Flength, Fheight, Fspace, Fdiam)

   #local i=0;
   #while(i< Flength/Fspace+1 )
      cylinder{ <0,0,0> <0,Fheight,0> Fdiam/2 }
      translate <i*Fspace, 0, 0>
     #local i=i+1;
   #end

#end


the macro itself is ok when rendered, but of course you only get a black
screen.
When i try to call the macro in an object as following, i get an error "no
matching '}' in object, cylinder found instead".
I allready found out the problem has to do with the #while loop. but i can't
find how to fix. Please can someone guide me throug this?


object{
   Fence(400, 150, 20, 1.5)
   pigment{ rgb .1 }
   }


Post a reply to this message

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