vtkCamera issues
Ken Martin
ken.martin at kitware.com
Thu Apr 20 09:35:10 EDT 2000
At 09:34 PM 4/19/00 -0400, David Gobbi wrote:
>Hi All,
>
>There were a couple regression tests, 'AllWriters.tcl' and
>'byuReader.tcl,' which were failing because they didn't call
>ComputeViewPlaneNormal() after setting up the camera.
>
>These examples used to produce some weird shear projection because
>vtkCamera used to compute the View matrix based on a combination of
>Position-FocalPoint and ViewPlaneNormal. My recent vtkCamera
>changes compute the View matrix using just Position-FocalPoint
>(and ViewUp, of course).
>
>So my question is this: how would people feel if I deprecated
>SetViewPlaneNormal() and caused the ViewPlaneNormal to be
>automatically calculated every time SetPosition() or
>SetFocalPoint() was called?
What are you saying here David? Are you saying you are going to remove the
ability to do off axis projections from VTK ? I don't think that is a good
option if that is what you are suggesting. The reason we have View plane
normal is because it isn't the same as Direction of Projection (VPN is not
necc == DOP) The vector from the position to the focal point is the DOP.
The VPN is the normal of the viewing plane.
>If this was done, paranoid code like this (straight from
>the VTK regression tests) could hopefully be avoided:
The code below has an extra line anyhow. There is no need to compute the
view plane normal and set it. Just one or the other. So you are talking
about eliminating one line of code.
>vtkCamera aCam
> aCam SetFocalPoint 0.00657892 0 2.41026
> aCam SetPosition -1.94838 -47.1275 39.4607
> aCam ComputeViewPlaneNormal
> aCam SetViewPlaneNormal -0.0325936 -0.785725 0.617717
> aCam SetViewUp 0.00653193 0.617865 0.786257
> aCam SetClippingRange 1 100
>
>and replaced with more concise code:
>
>vtkCamera aCam
> aCam SetFocalPoint 0.00657892 0 2.41026
> aCam SetPosition -1.94838 -47.1275 39.4607
> aCam SetViewUp 0.00653193 0.617865 0.786257
> aCam SetClippingRange 1 100
>
>Any thoughts?
>
> - David
>
>--
> David Gobbi, MSc dgobbi at irus.rri.on.ca
> Advanced Imaging Research Group
> Robarts Research Institute, University of Western Ontario
>
More information about the vtk-developers
mailing list