[vtkusers] I have a problem with the vtkApplyTransform

york yorktim at bit.edu.cn
Sun Nov 21 10:00:25 EST 2004


I 'm trying to give the camera a new matrix, but I found the matrix is not that I 
have given it after the function  "objectRen->GetActiveCamera()->ApplyTransform(t)".


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 

	


        york
        yorktim at bit.edu.cn
          2004-11-21





More information about the vtkusers mailing list