POV-Ray : Newsgroups : povray.newusers : Help with frame_number : Help with frame_number Server Time
5 Nov 2024 01:23:57 EST (-0500)
  Help with frame_number  
From: Brendan Ryan
Date: 20 Aug 2002 01:02:40
Message: <3D61CD05.7040206@global2000.net>
I declared some variables that are used by if-else statements to control 
the apperence of my before-after Mars landscape.  I used a switch 
statement to set the variables to different values for different frames, 
but when I rendered it with the command line +KFI1 +KFF7, only the first 
case version of the scene is rendered for all seven frames.  How do I 
get the frames to show the different versions of the scene?

Here're the variables and the switch statement.  I have tested the 
actual code manually by changing the variables' values before I made the 
switch statement so I know that the if-else code that choose between the 
different scene elements works fine so I didn't include that here.

#declare have_water = 0;
#declare have_clouds = 0;
#declare dust_storm = 0;
#declare night = 0;
#declare flood = 0;

#if(clock_on)

#switch(frame_number)

#case(1)
#break  //use values already set

#case(2)
#declare night = 1;
#break

#case(3)
#declare have_water = 1;
#declare have_clouds = 1;
#break

#case(4)
#declare flood = 1;
#break

#case(5)
#declare flood = 0;
#declare night = 1;
#break

#case(6)
#declare night = 0;
#break

#case(7)
#declare have_water = 0;
#declare have_clouds = 0;
#declare dust_storm = 1;
#break

#end
#end

Brendan


Post a reply to this message

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