[vtkusers] Create polyData from 4 points

David E DeMarle dave.demarle at kitware.com
Thu Dec 3 10:02:55 EST 2009


Look at vtkAreaPicker::AreaPick() and ::DefineFrustum(). That uses the
renderer to get 8 world space coordinates out of the four screen space
coordinates. After that you need to create a vtkPolyData, makes those
8 points it's Points, and then make up one or more Cells that refer to
those points.

David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109



On Thu, Dec 3, 2009 at 12:34 PM, Francesco Ferro <le_maitre at bluewin.ch> wrote:
> Hi all,
>
> I would like to know if is it possible to create a polydata from 4 points ?
> here an example of what I'm trying to do.
>
> 1. I have a windows where I can display 3D object and where I can draw with
> the mouse on a 2 overlay (using Actor2D and polyMapper2D...)
>
> 2. I click on my windows 4 times that will create 4 points on my windows
> (imagine I click the 4 edges of a square for example....)
>
> 3. I'd like then  draw lines between there 4 pointes (so it will display
> like a 2d square...)
>
> 2. And then I'd like from these 4 points create a 3D object. with the X and
> Y dimension I clicked and an "infinite" or very longue dimension in Z.
>
> Is there any easy way or Intelligent way to do that ? Storing the points in
> a particular data or array ?
>
> Thank's in advance
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list