[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] zooming in when using perspective projection via
From:       Milos Ilak <ilak () mech ! kth ! se>
Date:       2010-09-28 12:30:47
Message-ID: AANLkTimok2sqe4hRF1HkjUM7XTNrskiF--NmAQY-acm_ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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 ca=
n
> be zoomed simply, just using vtkCamera.Zoom(float), which supposedly zoom=
s
> 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 usin=
g
> the vtk module and create the vtkCamera for that renderer, i.e., there wo=
uld
> 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 class=
es
> 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 hav=
e
> to code up all the transformations by hand to obtain the new camera posit=
ion
> for parallel projection...Thanks,
>
> Milos
>
>
> --
>  Milo=C5=A1 Ilak
> Linn=C3=A9 Flow Centre
> KTH Mechanics, Stockholm
> +46(0) 8 790-7152
> www2.mech.kth.se/~ilak <http://www2.mech.kth.se/%7Eilak/>
>
>
>

[Attachment #5 (text/html)]

Hi all,<br><br>sorry to be repeating the question, but I haven&#39;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<br><br>V.vtkCamera.Zoom(float)<br> <br>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,<br> <br>Milos<br><br><br><br><br><br><br><div class="gmail_quote">On Fri, \
Sep 24, 2010 at 11:47 AM, Milos Ilak <span dir="ltr">&lt;<a \
href="mailto:ilak@mech.kth.se">ilak@mech.kth.se</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> Hi,<br><br>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&#39;t &#39;move&#39;.<br>

<br>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. <br>
<br>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&#39;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<br>
<br>V.vtkCamera.Zoom(float)<br><br>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&#39;t have to code up all the transformations by hand to \
obtain the new camera position for parallel projection...Thanks,<br>

<br>Milos<br><font color="#888888"><br clear="all"><br>-- <br><font \
color="#888888"><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); \
font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; \
font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px;"><span \
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; \
letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px;"><div>

<div><span>Miloš Ilak</span></div><div>Linné Flow Centre</div><div>KTH 
Mechanics,  Stockholm  </div><div>+46(0) 8 790-7152</div><div><a \
href="http://www2.mech.kth.se/%7Eilak/" \
target="_blank">www2.mech.kth.se/~<span>ilak</span></a><br><br></div></div></span></span>
 </div></font><br>
</font></blockquote></div><br><font color="#888888"><div><span \
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; \
letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; \
color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; \
font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: \
normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: \
0px;"><div> <div><br></div></div></span></span>
</div></font><br>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic