[vtkusers] Drawing objects interactively in VTK..??

David Doria daviddoria+vtk at gmail.com
Tue Apr 6 08:29:52 EDT 2010


On Tue, Apr 6, 2010 at 5:13 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> Hello,
>
> I am trying to draw a polyline interactively (with help of mouse). What i'm
> doing is at every left button down event, i get the mouse position and store
> it is a vector list. Later using this points am displaying on the rendering
> window.
>
> But when i do this, i noticed the following:
>
> The mouse position values are totally different from the the points which
> are displayed.. I mean, i click at one location, and it is displayed at far
> end another location..
>
> I tried changing the coordinate system also.. Still the result is
> unchanged..
>
> Any suggestions how it is to be done..??
>
> Thanks
> Rakesh Patil
>

Sounds like you may need a coordinate system conversion in there
somewhere, check out:
http://vtk.org/Wiki/VTK/Examples/Coordinate

It also sounds like you are trying to duplicate already working code in:
http://vtk.org/Wiki/VTK/Examples/Widgets/ImageTracerWidget

Thanks,

David



More information about the vtkusers mailing list