[vtkusers] vtkCamera viewTransformMatrix seems wrong
alykhantejani
alykhan.tejani06 at imperial.ac.uk
Tue Aug 6 06:06:57 EDT 2013
I have an object at the origin and am moving the camera to (0,650,650) and
setting the focal point to the origin i.e.:
vtkSmartPointer<vtkCamera> cam = vtkSmartPointer<vtkCamera>::New();
renderer->SetActiveCamera(cam);
cam->SetFocalPoint(0., 0., 0.);
cam->SetPosition(0., 650, 650);
cam->SetViewAngle(view_angle_);
cam->SetViewUp(0., 1., 0.);
However when I get the view transform matrix of the camera by:
vtkSmartPointer<vtkMatrix4x4> transform_view =
cam->GetViewTransformMatrix();
And print it I get the following:
| 1 | 0 | 0 | 0 |
| 0 | cos(45) | -sin(45)| 0 |
| 0 | sin(45) | cos(45) | -919.239 |
| 0 | 0 | 0 | 1 |
Where the rotation part seems correct (45 degrees around the x axis) but the
translation seems all wrong. Should the last column not be:
| 0 |
|650|
|650|
Or am I doing something wrong?
Thanks
--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkCamera-viewTransformMatrix-seems-wrong-tp5722503.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list