[vtk-developers] Strange behavoir in vtkCamera

Silvano Imboden s.imboden at cineca.it
Wed Mar 26 13:07:10 EST 2003


Lisa Avila wrote:
 > Hello Silvano,
 >
 > Changing vtkCamera::ComputePerspectiveTransform would change more than
 > just the reset camera functionality - it would change the notion of how
 > the view angle is measured. Of course, looking at the code I now see
 > that there is a UseHorizontalViewAngle flag (default 0) that can be used
 > to consider the view angle in the x rather than the y direction. You
 > could then write your own reset functionality that switched this
 > variable based on whether the width or the height of the window was
 > greater.

Great - I really don't like too much to mess in the vtk code,
this give me a chance to reach what I neeed from outside. Thanks.

 > One other note - it looks like Chris Volpe made the change to add the
 > horizontal option - but it does not seem to be propagated to the
 > parallel case (just in perspective). I suspect this is a bug and I will
 > correct it.

That's easy - or, so it seems to me

 > I am suspicious of this change - there are places outside of
 > vtkCamera that assume that the field of view defines the angle in Y and
 > unless all of these were changed as well then it is likely that using
 > the horizontal flag will result in bad images.

This is not easy - I hope that you have time to investigate
in this direction.

I just want to tell you that I'm experiencing problems with the picker
(it doesn't find thing exacly where they apper) and this could be
related to my changes vtkCamera. But I'm not exacly shure, consider this
just a hint.

Now, if you have time, I have another question.
Everything started because here at Cineca we are working on a
project that deal with medicine, and we work often with "femours".
Femours are thin and long.

In vtkRenderer::ResetCamera(float bounds[6])
you calculate "width" considering width of the bounding-box
along x and y. Then you compute the "distance" of the camera
considering "width" and the view-angle. further distance is
increased by half the width of the bounding-box along z.
(bounds are in world coordinate, not in camera coord.)

In my understanding, this work well only if the camera
is watching at the scene from the z-axis, and it still work
from any direction if the bounding-box is near to cubic,
but it doesn't work in the general case.

So I'm wondering if it's a my misunderstanding
or there are some reason to do so.

Thank you -- Silvano
====================
s.imboden at cineca.it
====================







































More information about the vtk-developers mailing list