[vtk-developers] bounds calculation in vtkActor

Rusty Blue rusty.blue at kitware.com
Wed Oct 27 23:25:49 EDT 2010


Hey Bill,

Agreed (on all)... but not sure which way to go yet.  

I was trying to keep the change as simple as possible but there are some
rumblings of maybe switching vtkProp3D::Transform to a
vtkPerspectiveTransform, so that we wouldn't force a vtkLinearTransform to
act like a vtkHomogeneousTransform.

Rusty

-----Original Message-----
From: Bill Lorensen [mailto:bill.lorensen at gmail.com] 
Sent: Wednesday, October 27, 2010 8:35 PM
To: Rusty Blue
Cc: vtk-developers at vtk.org
Subject: Re: [vtk-developers] bounds calculation in vtkActor

Rusty,

I would think it should be consistent across ImageActor and Volume. I
also suggest you push it to Gerrit for code review. And you should
provide or modify a test to illustrate it.

Bill

On Wed, Oct 27, 2010 at 8:29 PM, Rusty Blue <rusty.blue at kitware.com> wrote:
> Folks,
>
>
>
> We're setting the UserMatrix of an actor to... surprise, surprise...
> transform the actor.  Nothing exciting, right?
>
>
>
> Wrong, because the last row of our matrix is not the trivial [0 0 0 1].
> This is handled well enough in OpenGL, but the bounds calculation (in
> vtkActor::GetBounds()) is seriously wrong because it is doing a linear
> transformation of the bbox it gets from the mapper (Transform is a
> vtkLinearTransform):
>
>
>
>     fptr = bbox;
>
>     for (n = 0; n < 8; n++)
>
>       {
>
>       this->Transform->TransformPoint(fptr,fptr);
>
>       fptr += 3;
>
>       }
>
>
>
> The easiest fix I found for the issue was the following (force call to
> InternalTransformPoint of vtkHomogeneousTransform):
>
>
>
>     fptr = bbox;
>
>     this->Transform->Update();
>
>     for (n = 0; n < 8; n++)
>
>       {
>
>
>
this->Transform->vtkHomogeneousTransform::InternalTransformPoint(fptr,fptr);
>
>       fptr += 3;
>
>       }
>
>
>
> The change doesn't cause any tests to fail (for me)... and it seems like a
> reasonable change (perhaps should be made in vtkImageActor and vtkVolume
as
> well?)... but I wanted to put it out there (before I committed and pushed
> the change), because it is seriously likely that I'm not considering some
> other special "situations", or perhaps the "right" way to fix this, or
????
>
>
>
> Rusty
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>




More information about the vtk-developers mailing list