hi all,<br><br>      i encounter a problem, and need your kind help ! I get 3D global coordinate by using vtkCellPicker, then i want to know the 2D coordinate of point which is picked in the 3D scene.  However, the 2D coordiante i transformed was not accurate. Could anyone give some suggestion or better methods? thanks in advance!<br>

<br>All related code is as follows:<br>    vtkBMPReader *m_read=... // read bmp image   <br>    m_read-&gt;SetDataSpacing(CReadBmp::m_Dx,CReadBmp::m_Dy,CReadBmp::m_Dz);//        <br>    m_read-&gt;SetDataExtentCReadBmp::m_Xmin,CReadBmp::m_Xmax,CReadBmp::m_Ymin,CReadBmp::m_Ymax,CReadBmp::m_Zmin,CReadBmp::m_Zmax);//<br>

<br><br>    vtkInteractorStyleTrackballCamera *style;<br>    vtkRenderWindowInteractor *iren;<br>    vtkCellPicker *picker;<br>    iren-&gt;SetInteractorStyle(style);<br><br>    style-&gt;AddObserver(vtkCommand::MiddleButtonReleaseEvent, cmd);<br>

    cmd-&gt;SetCallback(MyExecute);<br>    picker-&gt;SetTolerance(0.0001);<br>    iren-&gt;SetPicker(picker);<br><br>void MyExecute(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)<br>{<br>    double globalCoordinate[3]; //<br>

    double selPt[2];<br>    picker-&gt;Pick(psurface-&gt;iren-&gt;GetEventPosition()[0],psurface-&gt;iren-&gt;GetEventPosition()[1],0, psurface-&gt;aRenderer);<br>    picker-&gt;GetPickPosition(globalCoordinate);        <br>

     <br>     int _2DCoor[3];<br>//<span style="color: rgb(255, 0, 0);"> this is the map formula</span><br>  <span style="color: rgb(255, 0, 0);">    _2DCoor[0] = static_cast&lt;int&gt;(globalCoordinate[0] / CReadBmp::m_Dx); //2D x Coordinate</span><br style="color: rgb(255, 0, 0);">

<span style="color: rgb(255, 0, 0);">   </span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">    _2DCoor[1] = CReadBmp::m_Ymax + 1 - static_cast&lt;int&gt;(globalCoordinate[1] / CReadBmp::m_Dy);//2D y Coordinate</span><br style="color: rgb(255, 0, 0);">

<br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">    _2DCoor[2] = static_cast&lt;int&gt;(globalCoordinate[2] / CReadBmp::m_Dz + 0.5) +  CReadBmp::m_Zmin ; </span>// the index of image<br><br>}<br><br>

<br>wenwu<br><br><br><br><br>