[vtkusers] Re: Re: I have a problem about vtkCamera matrix

york yorktim at bit.edu.cn
Mon Nov 22 21:06:17 EST 2004


Hi Goodwin
I have post my code on the list some days ago.
The subject is "I have a problem with the vtkApplyTransform"

My code like this
////
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
ReadPMatrix(matrix);//read the matrix from file
	                //the matrix is
					//129.448 -11.0671 9.5896 40.0671 
					//-1.97987 -60.2148 -24.7911 128.215 
					//0.100336 0.198658 0.0203686 0.801342 
					//0 0 0 1 
.
.
.
vtkRenderer *objectRen = vtkRenderer::New();
vtkTransform *t = vtkTransform::New();
t->SetMatrix(matrix);//set the tranform's matrix
objectRen->GetActiveCamera()->ApplyTransform(t);//Apply the Transform

//Reread the Matrix
vtkMatrix4x4 *tempMatrix = objectRen->GetActiveCamera()->GetViewTransformMatrix();
		//But the Matrix now is
		//0.00434187 0.0025011 0.999987 -1.29598 
		//-0.932646 -0.360758 0.00495178 83.619 
		//0.360766 -0.932656 0.000766277 -19754.4 
		//0 0 0 1 



Thanks a lot!
	

		

        york






More information about the vtkusers mailing list