[vtkusers] vtkPointPicker peter_piper

Will Schroeder will.schroeder at kitware.com
Fri Jun 30 10:02:40 EDT 2000


Hi Erik-

At 04:36 PM 6/28/00 -0400, Erik Sobel wrote:
>Does anyone know how to convert a display point (x,y) to a world point?
>
>I've tried...
>         ren1  SetDisplayPoint $x $y 0
>         ren1 DisplayToWorld
>         set wp [ren1 GetWorldPoint]
>This sort of worked until I moved the camera then the values were screwy.

If you move the camera, then the display point coordinates will most likely change, make sure you do that.


>I've tried
>         vtkPointPicker pp
>         pp Pick $x $y 0 ren1
>(hmmm, ok now how do I get the world coords out of this confounded object ????)
>
>What's the difference between a vtkPointPicker and a vtkWorldPointPicker? vtkNitPicker? vtkNosePicker?

Picking has changed significantly recently....are you using the nightly release (or accessing CVS)?
In the current version, world point picker can determine x-y-z position, but not the prop that is picked.
vtkPointPicker can determine the picked prop (if any), and the point id that was picked (within a tolerance).

Look at vtk/graphics/examplesCxx/pickCells.cxx for usage.


>vtkPointPicker peter_piper
>proc  Pick_Pickled_Peppers {} {
>         if  { [ peter_piper Pick $x $y 0 renP ] == $PECK } {
>                 return $NUM_PICKLED_PEPPERS
>         }
>}

Nice variable naming convention :-)

Will





More information about the vtkusers mailing list