[vtkusers] Hi, Question about point picking.
Hui Zhang (James)
zhang at isis.imac.georgetown.edu
Wed Sep 15 11:20:45 EDT 2004
Hi,
I have a problem in picking a point in the viewport. What I do is to click one point in the window and try to get the coordiate in world system. After click the mouse, I can get the x, y position, then .
float pos[3], z = 0;
vtkWorldPointPicker* picker = vtkWorldPointPicker::New();
// vtkPropPicker* picker = vtkPropPicker::New();
picker->Pick(x, y, z, m_Renderer);
picker->GetPickPosition(pos);
I found that regardless where I click the point, they will respond the same Zbuffer value. I check using with the following code
float z2 = m_Renderer->GetZ(x, y);
So I found the return value of z2 is always 1.0 regardless of x and y. Feel strange about it, anyone has some code to get the world coordinate from selected point in the viewport?
Thanks
---------------------------------------------------------------------------------------------------
Hui Zhang (James), Ph.D.
Imaging Science and Information Systems (ISIS) Center
Radiology Department, Georgetown University Medical Center
2115 Wisconsin Avenue, Suite 603, Washington, DC 20007
Office: 202-687-2902
Cell: 240-643-7103
Fax: 202-784-3479
Web: www.isis.georgetown.edu
Email: zhang at isis.imac.georgetown.edu
---------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040915/3cd3f771/attachment.htm>
More information about the vtkusers
mailing list