POV-Ray : Newsgroups : povray.advanced-users : Pov Zig Zag animation and rendering window Server Time
26 Dec 2024 01:56:13 EST (-0500)
  Pov Zig Zag animation and rendering window (Message 1 to 4 of 4)  
From: dinos
Subject: Pov Zig Zag animation and rendering window
Date: 15 Nov 2005 13:35:00
Message: <web.437a2948bf4e4aff2ec3938e0@news.povray.org>
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
2) I was wandering if I can define a camera window in order to render a part
of the whole scene of predefined size.

I would be grateful in any ideas

Thanks a lot
dinos


Post a reply to this message

From: Chris B
Subject: Re: Pov Zig Zag animation and rendering window
Date: 15 Nov 2005 18:46:15
Message: <437a7347@news.povray.org>
"dinos" <din### [at] freemailgr> wrote in message 
news:web.437a2948bf4e4aff2ec3938e0@news.povray.org...
> 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
> 2) I was wandering if I can define a camera window in order to render a 
> part
> of the whole scene of predefined size.
>
> I would be grateful in any ideas
>
> Thanks a lot
> dinos
>
>
>

Hi,

1) It's not totally clear to me from your question, what it is exactly that 
you are trying to do. Also you've not described the results your getting 
that you find frustrating. One guess would be that you may be defining no 
frames in between the end of one row and the beginning of the next row, 
which would make the animation difficult for the eye to follow and would 
result in a very jumpy animation. If this is the problem, you could try 
adding a small number of frames on the diagonal line returning the camera to 
the start of the next row. For example, if you have 20 frames following a 
horizontal course from left to right, you could try 4 frames on the inclined 
path back to the start of the next row. If you're defining an animation 
loop, then add a few on the diagonal back from bottom right to top left as 
well.

2) Once again, I'm not quite sure what you are asking, You can adjust the 
resolution of the camera window (in the Windows version you can use the 
'preset render options' pull-down towards the top left of the screen) and 
you can move the camera closer to the obect to render less of the scene. 
Also, in the Windows version, once you've rendered a scene once, you can 
select a rectangle using the mouse in the render window to just render that 
portion of the scene.

I see you had a go at posting these question before in the animations group, 
but I don't see any responses there. It would have probably been more 
productive to have posted your animation (or a part of it) along with the 
question, so that people could see the sort of problems you were trying to 
fix. The second question would probably have got a better response in the 
povray.newusers newsgroup. Either way, posting a question on the 'advanced' 
newsgroup and starting it with "I'm a brand new user of POV-Ray" is not the 
best way to make friends and influence people.

Regards,
Chris B.


Post a reply to this message

From: Alain
Subject: Re: Pov Zig Zag animation and rendering window
Date: 15 Nov 2005 21:34:42
Message: <437a9ac2@news.povray.org>
dinos nous apporta ses lumieres en ce 2005-11-15 13:30:
> 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
> 2) I was wandering if I can define a camera window in order to render a part
> of the whole scene of predefined size.
> 
> I would be grateful in any ideas
> 
> Thanks a lot
> dinos
> 
> 
> 
In an aninmation, you don't need a loop to do the translation. What you need is to use
the clock to 
move the camera or the object that will do the zig-zag. The rest is just dessiding on
the timing you 
want.
You usualy use a while loop when you want to put several similar objects in your
scene. There are 
many other uses, but that's one of the most obvious.

-- 
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may make you think you are whispering when you are
not.


Post a reply to this message

From: Matt Denham
Subject: Re: Pov Zig Zag animation and rendering window
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.