[vtkusers] Display to world coordinates, margin of error?

Beau Sapach beau.sapach at ualberta.ca
Wed May 11 17:51:41 EDT 2005


Hello everyone,

 

If I draw a line on an image (vtkActor2D and vtkLineSource) I can use
vtkLineSource::GetPoint1() and vtkLineSource::GetPoint2() to find the
Display coordinates of the line's end points, then I translate those into
world coordinates (using a vtkCoordinate) and all is well.  If I resize the
render window I convert the other way, changing my stored world coordinates
to display coordinates and then assigning them to the vtkLineSource so that
the line will appear in the same position on the image.  This works like a
charm.... but if I then translate back to world coordinates the values are
slightly different than the first time around.  I'm assuming this is a
problem with the difference in the resolution of the 2 coordinate systems,
and of course the changing view port.  Can anyone suggest a way to remedy
this?  Thanks!


Beau 

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


More information about the vtkusers mailing list