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:35:20 EDT (-0400)
  Re: camera orbit with simultaneous image plane rotation  
From: Alain
Date: 14 Jan 2011 12:58:57
Message: <4d308ee1@news.povray.org>

> Hi,
>
> I am using povray to generate projections of anatomical structures derived from
> a DICOM RT Structure Set. In essence I need to simulate a camera orbit about
> each structure - in fact I rotate the structure using the clock parameter and
> keep the camera fixed. These projections are the precursor to defining radiation
> fields in radiotherapy and the camera represents a linear accelerator used for
> the treatment.
>
> I now need to make my simulation more general by allowing for camera roll, i.e.
> rotation of the image plane (anti)clockwise about look at vector see
> http://wiki.povray.org/content/Documentation:Reference_Section_3#Placing_the_Camera
>
>
> povray -D mlc[Synergy]+Q0 +KFF90 +I/home/twostepgen/PTV0_0.pov i.e. 90
> projections in orbit mlc[Synergy] defines image plane dimensions
>
> PTV0_0.pov
> #include "/home/twostepgen/PTV0.inc" - a mesh2 object
> camera {
>     perspective
>     location<0 100 0>
>     up<0,0,-1>
>     right<-1.33,0,0>
>     angle 11.9882
>     look_at<0 0 0>
> rotate -z*(178+(clock*-356))
> }
>   light_source {<0,10,0>  color rgb 1 }
>
> object{PTV0 translate<0.775167,-18.0811,7.82013e-05>}
>
> translate is used to ensure that the "looked at" point is located at coordinates
> 0 0 0
>
> In particular there are some instances where I need a constant roll angle for
> all projections along the entire orbit. In other instances I need to adjust the
> roll angle from one clock "tick" to the next. What is the most
> efficient/simplest way of doing this?
>
> Many thanks
>
> Mark
>
>

You can change your rotation as:

rotate <0, 90*clock, -178+(clock*360)>
and use +kc to set the clock to cyclical animation.

This will first rotate the camera around the Y axis, then rotate it 
around the Z axis.
The result is a camera that smoothly rotate around the 2 axis during the 
animation.

You can use something like:

int(30*clock)*12

To rotate in 12 degrees increments, doing a complete rotation in 30 steps.






Alain


Post a reply to this message

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