[vtkusers] Transformation Matrix

Ahmad Hosseinzadeh ahmadhosseinzadeh at yahoo.ca
Sat Nov 13 09:57:13 EST 2004


Hello,
I use QVTKRenderWindowInteractor and want to move a 3D
model to the center
of the Interactor so that all the model be visible.

I have two problems:

1- I used the following code to find the required
transformation but it does not answer.
The problem is with the translation in z-axis.

----------------------------

        # Store the camera state.

        matrix  = self.camera.GetViewTransformMatrix( 
                 )
        x1      = matrix.GetElement( 0, 3 )
        y1      = matrix.GetElement( 1, 3 )
        z1      = matrix.GetElement( 2, 3 )
        self.ren.ResetCamera(                         
                 )
        matrix  = self.camera.GetViewTransformMatrix( 
                 )

        tx  = matrix.GetElement( 0, 3 ) - x1
        ty  = matrix.GetElement( 1, 3 ) - y1
        tz  = matrix.GetElement( 2, 3 ) - z1

        # Load the camera state.

----------------------------

I tried much but I don't know how to find the
transformation matrix.
2- I also have problem with moving the center of
screen to the center of a selected area.

Would you please help me achieve the transformation
matrix?

Regards,
ahmad.

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca



More information about the vtkusers mailing list