[vtk-developers] why does vtkOpenGLCamera set its own aspect ratio?

David Gobbi dgobbi at irus.rri.on.ca
Fri Feb 23 12:11:58 EST 2001


Hi Michael,

This change sounds very reasonable, so send me the modified files and
(if there aren't any objections) I'll add them to VTK.  Please do a
couple checks to ensure that picking works in at least the trivial
cases, though (just by pressing 'p' in the interactor and ensuring
that the pick boundaries agree with the boundaries of the rendered
actors).

I agree with your ViewShear modification as well (in fact I wrote a
'Shear' method into vtkPerspectiveTransform precisely because
I thought it would be a useful camera operation).  Chances are very
good that no-one out there is using the ObliqueAngles.  Be certain,
though, to include a comment in the header file that describes
how to compute the shear from a pair of oblique angles just in
case anyone _is_ using ObliqueAngles.

Even better, leave Set/GetObliqueAngles in for now but wrap them in
a #ifndef VTK_REMOVE_LEGACY_CODE.

 - David


On Fri, 23 Feb 2001, Michael Halle wrote:

> 
> Is there a reason that vtkOpenGLCamera computes its own aspect ratio
> during a Render(), rather than using the one available from the
> renderer using ComputeAspect()/GetAspect()?
> 
> Why do I ask?  I want to add a "PixelAspect" field to vtkViewport to
> allow rendering for displays with non-square pixels.  ComputeAspect()
> will now roll the PixelAspect into Aspect, so any queries using
> GetAspect will work correctly.  Since OpenGLCamera computes and sets
> its own idea of the aspect ratio without PixelAspect, it tramples my
> best-laid plans.
> 
> Normal rendering seems to work fine with the trivial change
> (essentially changing SetAspect(aspect) to GetAspect(aspect)). I'm not
> sure about picking/stereo though.
> 
> If you have ideas, please let me know!
> 
> Michael Halle
> mhalle at bwh.harvard.edu





More information about the vtk-developers mailing list