POV-Ray : Newsgroups : povray.newusers : camera orbit with simultaneous image plane rotation : Re: camera orbit with simultaneous image plane rotation Server Time
2 Jul 2024 22:26:47 EDT (-0400)
  Re: camera orbit with simultaneous image plane rotation  
From: Alain
Date: 17 Jan 2011 13:59:08
Message: <4d34917c$1@news.povray.org>

>> You can change your rotation as:
>>
>> rotate<0, 90*clock, -178+(clock*360)>
>> and use +kc to set the clock to cyclical animation.
>
> Ok, it seems that I did not clearly define my problem. I have to simulate two
> general situations; firstly where the camera is at a fixed roll angle, say 15
> degrees for all positions along the orbit: rotate<0,15,(-178+clock*360)>  ??
>
>
> Secondly the more general case I need to adjust the roll angle between clock
> ticks by a variable amount, e.g. a typical sequence of roll angles for 15 clock
> ticks would be 0,1,3,5,7,5,3,1,0,1,3,5,7,5,3. Thus I would probably need to
> provide a file or parameter list containing the roll angles that are (somehow?)
> substituted into the .inc file at runtime. Alternatively I would need to avoid
> the full orbit (rotate keyword) and write 15 discrete projections which simulate
> the desired roll angles
>
> Mark
>

In that case, you can use an array that will contain your various rotations.

#declare Roll = array[16] {0,0,1,3,5,7,5,3,1,0,1,3,5,7,5,3}

This create the array and initialize it in one operation.
The element zero (first) can be used for single frame renderings, while 
the others will be used during an animation.

You ther access the elements like this:

Roll[frame_numnber]

Outside an animation, this internal variable evaluate to 0 (zero), and 
to non-zero during an animation.

This can be used as a rotation or the actual locations for your camera. 
It can also define the up, right, direction or sky vectors.

Note that the array can contain vectors that can be used normaly:
#declare Roll =  = array[15] 
{0,<0,20,-2>,<1,12,12>,3,<-5,5,5>,7,5,3,1,0,1,3,5,7,5,3}
The singles floats will be promoted to full vector status: 7 becomes 
<7,7,7>.


More advanced: You can use the spline feature. Please read the 
documentation about the implementation and use of the splines.
This can be somewhat overkill for what you want to acomplish.



Alain


Post a reply to this message

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