[vtkusers] problem in getting pick positions from vtkPropPicker()

Lichan.Hong at parc.com Lichan.Hong at parc.com
Wed Jan 8 21:01:08 EST 2003


I use the following piece of Java code to pick a Z-plane at Z=C:
	...
	vtkPropPicker picker = new vtkPropPicker();
	int pickingResult = picker.PickProp( x,  y, vtkPanel.getRenderer(), propCollection );
	if ( pickingResult == 0 ) return;
	double[] pickWorldCoords = picker.GetPickPosition();
	...
Where (x,y) is a pixel on my vtkPanel, and propCollection contains the Z-plane.

Here is the problem: in some cases, pickWorldCoords[2] == C, which is correct;
in other cases, pickWorldCoords[2] != C, which really puzzles me. I am wondering
if GetPickPosition() is the right call to return the world coordinates of the picking point.

By the way, I am using VTK nightly (as of Dec 12, 2002) and JDK 1.4.0 on Windows 2000 
platforms.

Any helps would be greatly appreciated.

Lichan






More information about the vtkusers mailing list