Quantcast

vtkCamera: add an equivalent to UseHorizontalViewAngle for parallel projection?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

vtkCamera: add an equivalent to UseHorizontalViewAngle for parallel projection?

Stefan Pfeifer
Hi everyone,

So the vtkCamera interprets the view angle as vertical by default. This
can be changed via

     camera->SetUseHorizontalViewAngle(true);

One of the effects is that the resizing behaviour of the windows
changes: The view now gets adjusted when the window's width changes, not
the height as before. At least that's my use case.

My problem is that this doesn't work with the parallel projection, as
there is no equivalent method to change the direction of the
ParallelScale. It's always vertical. So my suggestion would be to add
exactly that. Maybe call it SetUseHorizontalParallelScale so it would be
consistent with the Get/Set methods:

     Perspective: Get/SetViewAngle <-> Get/SetUseHorizontalViewAngle
     Parallel: Get/SetParallelScale <-> Get/SetUseHorizontalParallelScale

I haven't contributed before so I wanted to get some feedback on this
first. It doesn't seem very difficult to implement, so if you guys think
it makes sense I could give it a try.

Best regards
Stefan
_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: vtkCamera: add an equivalent to UseHorizontalViewAngle for parallel projection?

Elvis Stansvik

Den 21 mars 2017 3:39 em skrev "Stefan Pfeifer" <[hidden email]>:
>
> Hi everyone,
>
> So the vtkCamera interprets the view angle as vertical by default. This can be changed via
>
>     camera->SetUseHorizontalViewAngle(true);
>
> One of the effects is that the resizing behaviour of the windows changes: The view now gets adjusted when the window's width changes, not the height as before. At least that's my use case.
>
> My problem is that this doesn't work with the parallel projection, as there is no equivalent method to change the direction of the ParallelScale. It's always vertical. So my suggestion would be to add exactly that. Maybe call it SetUseHorizontalParallelScale so it would be consistent with the Get/Set methods:
>
>     Perspective: Get/SetViewAngle <-> Get/SetUseHorizontalViewAngle
>     Parallel: Get/SetParallelScale <-> Get/SetUseHorizontalParallelScale
>
> I haven't contributed before so I wanted to get some feedback on this first. It doesn't seem very difficult to implement, so if you guys think it makes sense I could give it a try.

Just a +1 from me as a user. I have a use for such an API right now.

Elvis

>
> Best regards
> Stefan
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>


_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Loading...