Hi,

Basically, this should work:

mitk::BaseRenderer* renderer  = 
mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow());
vtkRenderer* vtkRenderer = renderer->GetVtkRenderer();
vtkCamera*   camera = vtkRenderer->GetActiveCamera();
if (camera)
{
    camera->SetPosition(position[0],position[1],position[2]);
    camera->SetFocalPoint(focalPoint[0], focalPoint[1],focalPoint[2]);
    camera->SetViewUp(viewUp[0],viewUp[1],viewUp[2]);
}
vtkRenderer->ResetCameraClippingRange();

But notice that OpenGL coordinate system is left-handed.

Regards
Matthias



-----Ursprüngliche Nachricht-----
Von: Yashodhan Nevatia [mailto:[email protected]] 
Gesendet: Mittwoch, 15. September 2010 16:25
An: mitk-users
Betreff: [mitk-users] Using a vtkCamera for Augmented Reality

Hi,

I want to use the vtkCamera from a QmitkRenderWindow for Augmented reality. I 
have the intrinsic and extrinsic parameters for the camera (a model of the 
human eye) as a 3x4 matrix M=P*[R t], where P is a 3x3 matrix that models the 
intrinsic parameters, and [R t] are the extrinsic parameters (4x4 homogenous 
transform).

Please could some one help me with providing the parameters to the vtkCamera 
object?

Thank you!

Yashodhan

--
Yashodhan Nevatia
Systems Engineer

Space Applications Services
Leuvensesteenweg 325
B-1932 Zaventem
Belgium
Tel:  +32 (0)2-721.54.84
Fax:  +32 (0)2-721.54.44
URL: www.spaceapplications.com

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them 
to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to