POV-Ray : Newsgroups : povray.general : Recursive Macro Problem Server Time
9 Aug 2024 19:41:05 EDT (-0400)
  Recursive Macro Problem (Message 1 to 2 of 2)  
From: Chris S 
Subject: Recursive Macro Problem
Date: 3 Jun 2000 22:00:21
Message: <3939b835@news.povray.org>
I've hit a bit of a rock I haven't been able to climb over.  The recursive
macro below is *supposed* to generate a linear sphere_sweep, generating 10
sphere positions for the sweep.  It then uses the last coordinate as the
starting point for two other sweeps.

The coordinate calculations have a random element added to them to visualize
a contorted cone, essentially the segment of a root.  My final objective is
to generate a complex root system.  I added a color element, taken from
Samuel Benge's altered pyramid.pov example, to differentiate recursion
levels.

The problem I've run into is that the first recursion runs through the
coordinates used to position the first sphere in the next sphere_sweep but
doesn't reset them for the subsequent recursion.  As a result, when the root
"branches" the first branch will appear to connected to the original branch,
and it's first branch connected to it, but the second branch will appear at
the different position then the end of the former branch...

Sound confusing?  Sorry, but it has me stumped...  The source of the same
name in p.b.s-f is ready to render so it should explain the problem better
then I.  It's my first toy-around with a recursive macro so any help would
be appreciated.

Thanks,
-Chris-


Post a reply to this message

From: Margus Ramst
Subject: Re: Recursive Macro Problem
Date: 5 Jun 2000 11:48:37
Message: <393BBE05.DD4790E3@peak.edu.ee>
Check out my reply in p.b.s-f. It seems to work, although I'm not entirely sure
why the original doesn't.
The main change is duplication of the parameter block (see source), but I
tweaked a few other things also.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

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