POV-Ray : Newsgroups : povray.binaries.images : Stacking? : Re: Stacking? Server Time
18 Aug 2024 02:21:16 EDT (-0400)
  Re: Stacking?  
From: Scott Hill
Date: 17 Jul 2001 20:10:27
Message: <3b54d3f3@news.povray.org>
"Thomas Lake" <tla### [at] homecom> wrote in message
news:3b400622@news.povray.org...
> This may be a little off topic but I was wondering how it might be
possible
> to implement a stack in povray? Over the past few days I've been thinking
of
> developing a maze algorithm for pov. I've done some searching on the net
and
> from what I can see "depth first search" is a promising algorithm to use.

    If you want to do what I think you want to do, you're on the right lines
with a depth first algorithm, but, you don't need to implement the stack in
the POV scene description language. I take it you want a stack so that you
can implement a recursive algorithm ?
    Well, the POV scene description language supports recursion ! You just
need to do something like this :

//////////////////////////////////////
#macro recursive(count)
 #debug "."
 #if(count>0)
  recursive(count-1)
 #end
 #debug "\n"
#end

recursive(10)
/////////////////////////////////

    This is untested, but if you stick it into a .pov file and run it you
should see 11 periods appear in the debug window/on screen...

BTW, I implemented a similar algorithm when I was at Uni, only my program
had to solve a maze rather than build one, but the principle is basically
the same...

--
Scott Hill.
Software Engineer.
E-Mail        : sco### [at] innocentcom
Pandora's Box : http://www.pandora-software.com

*Everything in this message/post is purely IMHO and no-one-else's*


Post a reply to this message

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