POV-Ray : Newsgroups : povray.advanced-users : Pov Zig Zag animation and rendering window : Re: Pov Zig Zag animation and rendering window Server Time
28 Jul 2024 12:30:12 EDT (-0400)
  Re: Pov Zig Zag animation and rendering window  
From: Matt Denham
Date: 24 Nov 2005 02:45:00
Message: <web.43856e5911e0eb2974f3166b0@news.povray.org>
"dinos" <din### [at] freemailgr> wrote:
> Dear All,
>    I'm a brand new user of pov ray and I'm faced with two problems
> 1) I try to make a zig zag animation by traversing a scene using a clock and
> a while loop but the results are a bit frustrating. Its probably that I'm
> doing something wrong here or there is a more convenient way to to do so
> as an example I try to produce a number of frames for each row and restart
> the same operation again some pixels down the initial starting point and
> continue traversing the whole scene.
>                   -------------->
>                                 |
>                              |
>                           |
>                        |
>                     |
>                   |
>                   --------------> etc

As some of the other posters have mentioned, (1) your while loop is probably
not necessary (clock doesn't change during each frame - your while loop
basically turns into a simple #if, only uglier :->); and (2) if your
animation's "frustrating results" are due to it being uneven, you'll need
to render the retrograde diagonal passes as well - whether you want to do
this at the same speed, or much higher, is up to you.  A #switch block will
cover this adequately, as would just a simple
#if(mod(clock,X0_to_X0_duration)>X0_to_Xmax_duration)...#end block that
handles the movement.  (The latter option is less general, but will work as
long as each row requires the same duration.  If, however, you have rows
that take different durations, you'll be better off with the
#switch/#range(r0_left,r0_right)...#break/#range(r0_right,r1_left)...#break/.../#end
setup, which is more general but a heck of a lot longer.)

Example, if you want it as a loop, with constant "HBlank"/"VBlank"
intervals, and assuming that clock takes on the values between 0 and 1 over
one loop:

#if(clock<(1-VBlank))
#if(mod(clock,(1-VBlank)/rows)>((1-VBlank)/rows-HBlank))
// camera traverses row X
#else // HBlank interval
// camera moves backwards from end of row X to beginning of row X+1
#end // row
#else // VBlank interval
// camera moves backwards from end of last row to beginning of row 0
#end // image

Fill in the three regions as needed there.
> 2) I was wandering if I can define a camera window in order to render a part
> of the whole scene of predefined size.

Yes, this is doable; the +SC/+EC and +SR/+ER options are what you want.
+SC/+EC gives the X range, +SR/+ER gives the Y range.  +[S/E][C/R]0.xxx
gives a fraction of the image, good if you plan on rendering at different
resolutions rather than just wanting a region that's a specific number of
pixels in size no matter what the original image's resolution would be.

>
> I would be grateful in any ideas
>
> Thanks a lot
> dinos


Post a reply to this message

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