|
![](/i/fill.gif) |
> Hi
>
> I now need to modify my camera orbit slightly so that I start at a particular
> angle, stop at a particular angle rendering a number of scenes in between
> (number of frames, start and stop angle are determined at run time). I also need
> to enable both clockwise and anticlockwise rotations
>
> Thus I need something like
>
> rotate -z*(startAngle+(clock*stopAngle))
>
> or rotate +z*(startAngle+(clock*stopAngle))
>
> depending on the orientation ((anti)clockwise) of the orbit.
>
>
> i) How do I pass the parameters startAngle and stopAngle correctly into a
> generic script?
>
> ii) It may happen that during the camera orbit that the modulus of the term in
> brackets is< 0 or>360 degrees? Does povray do bounds checking to ensure 0<
> angle< 360 ? Or can I safely rely on basic trigonometry to give the correct
> mapping
>
> e.g. 365 degrees => +5 degrees and -27 degrees =>+333 degrees
>
> iii) To be more general I would like to allow the camera to rotate around the
> look at vector and then orbit the now rotated camera about the scene? This means
> that I need to update the up vector accordingly. Given that I am already
> translating the scene to be centred at<0 0 0> what is
> the easiest way to accomplish this: should I rotate the scene in the opposite
> direction by the appropriate angle, or the camera in the desired direction.
>
> Thanks
>
>
>
The rotation in a rotate statement is not limited to 360 degrees. rotate
<1000, -557, 10> is perfectly legal. Rotate 720 is the same as rotate
360 and rotate 0.
There is no easiest way to do your rotations. It all depends on how you
perceive/conceive it.
If, in your mind, it's easier to represent a rotation as a rotation of
the camera, thet's THE way you should do it. BUT, if your perseption of
the rotation involve a rotation of the environment, then you should
leave the camera stationary and rotate everything else.
If you bind your whole scene into a big union, there is nothing
preventing you from rotating the complete scene as one entity. Once
that's done, rotating the camera +67 degrees around the Y axis is
exactly the same as rotating the scene -67 around the same axis. Just be
sure that you also rotate your light source(s) with the rest of the scene.
Alain
Post a reply to this message
|
![](/i/fill.gif) |