------------------------------------------------------------------------------ Description: Transform from display to world coordinates. WorldPt has to be allocated as 4 vector
| 244 | // Transform from display to world coordinates. |
| 245 | // WorldPt has to be allocated as 4 vector |
| 246 | void vtkInteractorObserver::ComputeDisplayToWorld( |
| 247 | vtkRenderer* ren, double x, double y, double z, double worldPt[4]) |
| 248 | { |
| 249 | ren->SetDisplayPoint(x, y, z); |
| 250 | ren->DisplayToWorld(); |
| 251 | ren->GetWorldPoint(worldPt); |
| 252 | if (worldPt[3]) |
| 253 | { |
| 254 | worldPt[0] /= worldPt[3]; |
| 255 | worldPt[1] /= worldPt[3]; |
| 256 | worldPt[2] /= worldPt[3]; |
| 257 | worldPt[3] = 1.0; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | //------------------------------------------------------------------------------ |
| 262 | // Description: |