vtkCamera issues
David Gobbi
dgobbi at irus.rri.on.ca
Thu Apr 20 11:05:53 EDT 2000
Hi Ken,
I hadn't realized that the purpose of setting the VPN different
from the camera->focal point direction was for creating oblique
projections. There were no regression tests that used oblique
projections (except for the two that broke, and they weren't
supposed to).
A method SetObliqueAngles(phi,theta) might be a better way to
create an oblique projection than directly setting the VPN --
it would make it easier for users to immediately grasp what
is going on.
I'll leave the vtkCamera code as-is until we resolve these issues.
- David
--
David Gobbi, MSc dgobbi at irus.rri.on.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
On Thu, 20 Apr 2000, Ken Martin wrote:
> 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