|
![](/i/fill.gif) |
>
> 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
|
![](/i/fill.gif) |