[vtkusers] cell to pixel mappig (urgently required)
Obada Mahdi
omahdi at gmx.de
Tue Mar 14 11:33:55 EST 2006
Hi Mahmoud!
If you want to map screen coordinates to cell IDs, maybe "vtkCellPicker"
can help you.
On Tue, 14 Mar 2006, mahmoud ismail wrote:
> i display a 3d data object tht consists of group of cells
> and i want to know the pixel coordinate (x, y) appearing in the screen
> and corresponds to the 3D cell of th object
> [...]
> i.e i want to form a table
>
> pixel (x1,y1)----------------------cell no i
A "vtkCellPicker" lets you pick what is displayed at particular display
coordinates by calling its
| int Pick (double selectionX, double selectionY, double selectionZ,
| vtkRenderer *renderer)
method (leave "selectionZ" zero). This will pick from scene geometry rendered
by "renderer", and returns non-zero if a pick was made. In that case, you can
obtain the ID of the (closest) picked cell via "GetCellId()".
Have a look at the online docs at
http://www.vtk.org/doc/nightly/html/classvtkCellPicker.html
for more information.
Regards
Obada
More information about the vtkusers
mailing list