[vtk-developers] proposed change to vtkCamera parallel projection code
Michael Halle
halazar at media.mit.edu
Wed Feb 21 11:59:25 EST 2001
Hello,
I'm working on a project where I need to generate images with
orthographic (parallel), not perspective, projection. I need to alter
the angle that view rays intersect the view plane arbitrarily. In
effect, I want to control the shear of the three-dimensional volume
in both x and y wrt z.
Currently, the parallel projection code in vtkCamera only permits the
use of oblique angles to change this shear. They don't provide enough
freedom to control the x and y shear factors independently. I would
like to enhance vtkCamera to allow the arbitary shear factors, and
have the oblique angle close use it.
Here are the changes I'd like to make:
* Introduce a new camera parameter (ViewShear). View shear is something
like Direction of Projection, but in camera space, not world space.
This parameter will have three components: (dx/dz, dy/dz, zscale).
The first two parameters control the shear in x and y wrt z. The "zscale"
factor controls what point to shear around, scaled by the view distance.
Usually, this parameter will be 1, so the origin of the shear will be
at the view distance. Making "zscale" a scale factor makes ViewShear
be unitless, so it doesn't have to be constantly updated.
* Change the ObliqueAngle code to set the ViewShear vector.
* Change the ViewNormal calculation code to use ViewShear.
* Remove the GetObliqueAngle method --- we can't return oblique angles
for an arbitrary ViewShear. I can't think of any reason to read back
the oblique angles that couldn't trivially be moved into user code,
and it's esoteric enough that I don't think it will affect anyone.
Does it?
I'm writing the code now. Please let me know it these changes would
impact you.
Thanks.
Michael Halle
mhalle at bwh.harvard.edu
More information about the vtk-developers
mailing list