[Paraview] zooming in when using perspective projection via vtkCamera.Zoom

Milos Ilak ilak at mech.kth.se
Tue Sep 28 08:30:47 EDT 2010


Hi all,

sorry to be repeating the question, but I haven't been able to figure this
out, and it is the last remaining piece I need to complete my
animations...The question is: can one use something like

V.vtkCamera.Zoom(float)

or equivalent in perspective projection? I.e., I would like to zoom in a
straightforward fashion using Python scripts, and this seems to be possible
only using parallel projection and CameraParallelScale. Regards,

Milos






On Fri, Sep 24, 2010 at 11:47 AM, Milos Ilak <ilak at mech.kth.se> wrote:

> Hi,
>
> I would like to be able to zoom during an animation using perspective
> projection. I am doing everything via a Python script. For parallel
> projection, the transformation is simple and one zooms just by changing a
> constant factor, i.e., setting the CameraParallelScale variable, and the
> camera doesn't 'move'.
>
> In parallel projection, however, one needs to change the actual camera
> position and the transformation is not that simple. Looking at the Python
> trace after zooming with the middle button, ParaView just reports the new
> camera position, but not how it was calculated.
>
> Looking at vtk documentation, there is a class called vtkCamera, which can
> be zoomed simply, just using vtkCamera.Zoom(float), which supposedly zooms
> properly both in parallel and perspective projections, at least according to
> the documentation. What I can't figure out is how to call a renderer using
> the vtk module and create the vtkCamera for that renderer, i.e., there would
> be a RenderView object V of some sort, and we would just set
>
> V.vtkCamera.Zoom(float)
>
> However, there is no vtkRenderView or vtkView within the vtk Python classes
> provided by the module that comes with ParaView. Would someone be able to
> tell me what GetRenderView() in paraview acually calls? Or if I am headed in
> the wrong direction, how should this be done properly? I hope I don't have
> to code up all the transformations by hand to obtain the new camera position
> for parallel projection...Thanks,
>
> Milos
>
>
> --
>  Miloš Ilak
> Linné Flow Centre
> KTH Mechanics, Stockholm
> +46(0) 8 790-7152
> www2.mech.kth.se/~ilak <http://www2.mech.kth.se/%7Eilak/>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100928/46dc11ae/attachment.htm>


More information about the ParaView mailing list