[vtkusers] Y coordinate convert error in display to World coord

Michael Liu zhifengmuyu at gmail.com
Wed Jul 4 05:56:00 EDT 2012


Hi, all
I've been struggled with the problem for quite a while, still can't find
any clue for solve it.  :.(
I have a unstructred grid displayed in 3D
The issue is that a display coordinate point(x,y, 0) transfered to world
coordinate incorrectly. The wield thing is that while x coordinate is
converted properly, while Y coordinate is not.

Following is part of function code.

VTK_DECLARE(vtkRenderer, ren);
ren = GetRenderer();

//clicked point in pos
ren->SetDisplayPoint(pos.x(), pos.y(), 0.0);
qDebug()<<"Display:"<<pos.x()<<" "<<pos.y()<<" 0.0";

ren->DisplayToWorld();
double pt[4];
ren->GetWorldPoint(pt);

qDebug()<<"World:"<<pt[0]<<" "<<pt[1]<<" "<<pt[2]<<" "<<pt[3];


I am using QVTKWidget, and display coordinate origin is on the top-left of
the QVTKWidget.

If any valueable info on this issue is provided, I would greatly appreciate


Thanks,
feng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120704/3f8ef61b/attachment.htm>


More information about the vtkusers mailing list