POV-Ray : Newsgroups : povray.newusers : Decrement the number of objects as loop progresses : Decrement the number of objects as loop progresses Server Time
4 Jul 2024 13:44:20 EDT (-0400)
  Decrement the number of objects as loop progresses  
From: Haakon Meland Eriksen
Date: 12 Aug 2010 17:10:00
Message: <web.4c64625c4047dedb52d43ba0@news.povray.org>
I would like to do something like this

*
**
***
**
*

and decrement the number of objects in one direction as the loops progress. How
can I do this correctly? This does not work.

#declare IndexX = 0;

#while (IndexX <= 9)
        #declare EndZ = 9;
        #declare IndexZ = 0;

        #while (IndexZ <= EndZ)

                sphere {  <IndexX,1,IndexZ>, 0.1   texture {pigment{color Red}}}
        #declare EndZ = EndZ - 1;
        #declare IndexZ = IndexZ + 1;

        #end

#declare IndexX = IndexX + 1;
#end

Cheers,
Haakon


Post a reply to this message

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