POV-Ray : Newsgroups : povray.newusers : camera orbit with simultaneous image plane rotation : Re: camera orbit with simultaneous image plane rotation Server Time
5 Jul 2024 02:39:36 EDT (-0400)
  Re: camera orbit with simultaneous image plane rotation  
From: bobsta
Date: 25 Jan 2011 08:05:00
Message: <web.4d3eca4e863e0b1cc6ac940d0@news.povray.org>
>
> You always use cameraRoll[0] except for the very last frame that will
> use cameraRoll[1].
>
> The clock variable, by default, goes from zero to 1.
> When accessing the array, only the integer part is used, always
> returning zero and using only the first array element unless clock is 1
> or more.
>

okay

> If you substitute frame_number as follow:
>
> rotate <0,cameraRoll[frame_number*(frame_number<16)],-(178+(clock*-356))>
>
> You now sellect a different array element for each frame. The
> "*(frame_number<16) is there to ensure you never try to access array
> elements that don't exist.
>


>
> Another way to do about the same thing:
> rotate <0,cameraRoll[int(clock*15)],-(178+(clock*-356))>
>
> Here, you multiply the clock variable by the number of elements in the
> array to get the correct indices. The int(...) is not realy needed but
> is added for clarity.
>
> Advantage: you can use different number of frames. If you only render 5
> frames, you'll use every third element. If you render as a 120 frames
> animation, each elements will get used 8 times while you continously
> rotate around the z axis.
>

I have one further problem: Suppose I have an array of 4 values for the camera
roll, which I wish to use sequentially for 15 frames e.g.

cameraRoll = array[3]{1,3,5,7}

i.e. 1 degree is used for 1st,5th,9th,13th frame
     3 degrees is used for 2nd,6th,10th and 14th frame
     5 degrees is used for 3rd,7th,11th and 15th frame
     7 degrees is used for 4th,8th,12th frame

I need to use the float mod function
http://www.povray.org/documentation/view/3.6.1/228/ but am unsure of the correct
syntax in the .pov file i.e. something like the following



 rotation<0,cameraRoll[mod(float[frame_number],float[array_size])],-(178+(clock*-356))>


Thanks

Mark


>
>
> Alain


Post a reply to this message

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