POV-Ray : Newsgroups : povray.binaries.scene-files : stack.inc Server Time
7 May 2024 06:14:54 EDT (-0400)
  stack.inc (Message 1 to 2 of 2)  
From: Rainer Mager
Subject: stack.inc
Date: 12 Oct 1998 03:25:06
Message: <3621a0c2.0@news.povray.org>
Here is the stack.inc as promised in the binaries.animations group.

To use it do this:

// first include the file
#include "stack.inc"

// then initialize your stacks
Stack( "any_name" )
Stack( "any_other_name" )

// then push data
Push( "any_name", colPoint )
Push( "any_other_name", (<1,0.5,0.5> + BallsColor[id]) / 2 )

// then pop data
#local my1 = 0;
#local my2 = <0,0,0>;
#while( Pop( "any_name", my1 ) )
  // note: you DO need these tmp variable or POV complains
  #local tmp = Pop( "any_other_name", my2 );
#end




Notice how you can use any variable type in any stack. Just be consistant.

This is beta. The debug routines need cleaning up and it is not fully
tested.

--Rainer


Post a reply to this message


Attachments:
Download 'stack.inc.txt' (4 KB)

From: Rainer Mager
Subject: Re: stack.inc
Date: 12 Oct 1998 03:30:44
Message: <3621a214.0@news.povray.org>
Oops, forgot change in the file.

    You'll see it as soon as you use it, just put this:

    #if( STACK_DEBUG > 0 )
     #render concat( "from position ", str(StacksPos[i],0,0), "\n" )
    #end

instead of just:
     #render concat( "from position ", str(StacksPos[i],0,0), "\n" )

Sorry for the mistake.

--Rainer

Rainer Mager wrote in message <3621a0c2.0@news.povray.org>...
>Here is the stack.inc as promised in the binaries.animations group.
>
>To use it do this:
>
>// first include the file
>#include "stack.inc"
>
>// then initialize your stacks
>Stack( "any_name" )
>Stack( "any_other_name" )
>
>// then push data
>Push( "any_name", colPoint )
>Push( "any_other_name", (<1,0.5,0.5> + BallsColor[id]) / 2 )
>
>// then pop data
>#local my1 = 0;
>#local my2 = <0,0,0>;
>#while( Pop( "any_name", my1 ) )
>  // note: you DO need these tmp variable or POV complains
>  #local tmp = Pop( "any_other_name", my2 );
>#end
>
>
>
>
>Notice how you can use any variable type in any stack. Just be consistant.
>
>This is beta. The debug routines need cleaning up and it is not fully
>tested.
>
>--Rainer
>
>
>
>


Post a reply to this message

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