POV-Ray : Newsgroups : povray.general : How can I iterate a function in POV script? : Re: How can I iterate a function in POV script? Server Time
11 Aug 2024 11:17:07 EDT (-0400)
  Re: How can I iterate a function in POV script?  
From: Bob Hughes
Date: 22 Jul 1999 13:25:03
Message: <379753BF.945B8F03@aol.com>
The #while loop alone should work out okay. Just exampling below:

#declare S1 = 0  //use as many as you need of these to use on Spiral
#declare S2 = 1  //etcetera
#declare C = 0
#while (Count < 9)  //same as FOR i = 1 to 9
//put Spiral code here or use the inc file, with all the loop
manipulated parts
#declare S3 = S1+C  //whatever.
#declare C = C + 1 //or whatever. clock based value, anything...reaching
9
#include "Spiral.inc"  //alternatively use this
#end  //NEXT until loop reaches 9



Matt wrote:
> 
> Greetings ;>  Can anyone help me please -   ( POVray 3.00e, Pentium PC
> system)
> 
> In order to create a number of intertwined same-axis spirals, I think I
> need to be able to call a small block of POV script several times from
> within the same file if possible. What's the closest I can get to an old
> 'GOSUB'-type or PROC command?
> 
> The BBC BASIC equivalent of what I want to do would be:
> ---------------------------
> FOR i = 1 to 4
> PROC spiral
> NEXT i
> END
> 
> DEF PROC spiral
> {define a 3d spiral here, properties of which depend on value of i. Code
> contains loops, #define's, etc. as well as shape commands}
> ENDPROC
> ---------------------------
> So, how can I do this? I thought of #declaring the spiral routine first
> and then calling it a few times later, but it won't let me include other
> logic & directives with shape commands, apparently. Help!
> 
> Best wishes to you all
> 
> Matt Rhys-Roberts
> North Wales

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

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