[vtkusers] customizing the VTK projection matrix (i.e K[R T] to VTK projection)
AchkanSalehi
ashsalehi4133 at gmail.com
Tue Sep 29 04:07:16 EDT 2015
Hi,
I need to replace the projection matrix that VTK uses, and haven't succeded
thus far. I have the three matrices *K*,
*R*, *T*, which respectively represent the camera calibration matrix, the
Rotation and translation (i.e. the columns of *R* are the camera axes and
*T* is its position in world coodinates. I have tried:
//first, to obtain an identity projection matrix
camera->SetViewUp(0,1, 0);
camera->SetPosition(0, 0, 0);
camera->SetFocalPoint(0, 0, -1);
renderer->SetActiveCamera(camera);
// add orientation and translation: [R T]
vtkSmartPointer<vtkMatrix4x4> KRT=vtkSmartPointer<vtkMatrix4x4>::New();
//KRT->SetElement... So that the matrix looks like
R T
O 1
//with O=[0 0 0]
camera->SetModelTransformMatrix(KRT);
But i have no idea how to add the *K* matrix. I also think the orientation i
obtain with the lines above is wrong. From what i saw in the documentation
and other forums, this can be done by setting the focal point, up, etc, but
the documentation was as little bit unsufficient for me. So any help would
be greatly appreciated.
PS: I think it would also help if anyone could briefly explain how the VTK
projection matrix is related to the OpenGL projection matrix... Thanks
again.
--
View this message in context: http://vtk.1045678.n5.nabble.com/customizing-the-VTK-projection-matrix-i-e-K-R-T-to-VTK-projection-tp5734165.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list