[vtkusers] vtkCoordinate usage

David Doria daviddoria+vtk at gmail.com
Wed Feb 10 18:19:15 EST 2010


The vtkViewport::ViewToWorld() function converts a viewport coordinate (2D)
to a world coordinate (3D). Are you only supposed to consider the result of
the first two coordinates (ie. the (x,y) viewport coordinates get mapped to
an (x,y) world coordinate, and the z world coordinate is bogus?)

If that is correct, I am trying to use vtkCoordinate to get the world
coordinates of the mouse click. This is what I came up with:
http://www.vtk.org/Wiki/VTK/Examples/Interaction/ClickWorldCoordinates

The thought is that when you click on the outer edge of the sphere, the
magnitude of the (x,y) world point should be 5 (the radius of the sphere).
An even easier check is to click on the top point of the sphere (expecting
to get (0,5) and the right point of the sphere (expecting to get (5,0)). The
results are sane (the right point of the sphere is (something, 0), but it is
not 5. In fact, it varies with how zoomed in the camera is.

Anyone see the issue here?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100210/dcdfba5f/attachment.htm>


More information about the vtkusers mailing list