[vtkusers] wrong world to viewport coordinates

Oliver Kania ptw.freiburg at googlemail.com
Wed Oct 22 09:33:16 EDT 2008


Hello,
I have a vtkCoordinate with world-Coordinate system initialized.

vtkCoordinate* m_coord = vtkCoordinate::New();
m_coord->SetCoordinateSystemToWorld();

CDataSpace* l_space       = l_prop->GetBox().get();
m_coord->SetValue(l_space->x_min,l_space->y_min, 0.0);
m_x_viewport_begin = *(m_coord->GetComputedViewportValue(m_renderer));
m_y_viewport_begin   = *(m_coord->GetComputedViewportValue(m_renderer) + 1);

m_coord->SetValue(l_space->x_min,l_space->y_max, 0.0);
m_y_viewport_end  = *(m_coord->GetComputedViewportValue(m_renderer) + 1);
m_coord->SetValue(l_space->x_max,l_space->y_min, 0.0);
m_x_viewport_end  = *(m_coord->GetComputedViewportValue(m_renderer));


The condition l_space.min < l_space.max is always true.
I am using parallel projection and the cameras rotation or its angle is
not modified. The Z-Coordinate of the camera is ALWAYS positive.
However, after resizing the window, I get
mirrored coordinates, which means m_x_viewport_begin > m_x_viewport_end
in this case.

I am really lost with this and any help would be greatly appreciated.

Best regards,
Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081022/3f6838a3/attachment.htm>


More information about the vtkusers mailing list