Hi all,<br><br> I need to put the following camera's parameters (perspective projection model):<br><br>Viewplane at Z = 0<br>Eyepoint or center of projection at Z = -0,839 (being the focal length of the camera, noted d)
<br>Height (and width) of the RenderWindow = 2 (measured in millimeters)<br>ViewUp (0,1,0)<br><br>Then, this is the code I used to develop the previous camera model with the vtkCamera class:<span style="font-family: monospace;">
</span><pre style="font-family: arial,sans-serif;">
<font size="2">vtkCamera *camera = vtkCamera::New();<br><br>camera->SetViewUp(0, 1, 0); // ViewUp<br>camera->SetPosition(0, 0, -d); // Eyepoint<br>camera->SetFocalPoint(0, 0, 0); // Viewplane
<br>camera->ComputeViewPlaneNormal(); </font></pre><font size="2"><span style="font-family: arial,sans-serif;">double h = 2; // h is the height of the RenderWindow</span><br style="font-family: arial,sans-serif;">
<span style="font-family: arial,sans-serif;">double d = 0,839; // d is the distance from your eyes to the screen</span></font><font size="2"><br>double angleofview = 2. * atan((h/2.)/d); // angleofview = 2*atan((h/2)/d)
</font>
<br><br>camera->SetViewAngle(angleofview);<br><br>I tested it and It seems that it works, but I don't know if I'm properly using the vtkCamera<br>class to implement what I really need. <br><br>Any help will be grateful.
<br><br>Thanks all.<br>