[vtkusers] How to display points in VTK?

nadine kempe n.kempe at gmx.net
Fri Nov 2 14:52:17 EDT 2007


Hi,

that's exactly what I've done. I just inserted one point, but in my render window, i see not only one point. I see in each of the three directions 3 points around the specified coordinate, which means in the end I get a little 3D cross.

Has anyone an idea what's the reason for this strange behavior?

Thanks,
Nadine


-------- Original-Nachricht --------
> Datum: Fri, 2 Nov 2007 18:31:15 +0100
> Von: Bob <oraciotaglia at tiscali.it>
> An: vtkusers at vtk.org
> Betreff: Re: [vtkusers] How to display points in VTK?

> 2007/11/1, Alam, Mohammed <malam at med.wayne.edu>:
> [...]
> >
> > Can someone please explain me how can I display a set of points (cloud
> of
> > points) in VTK? What will the vtk file format and the process? Thank
> you.
> >
> [...]
> 
> Well, the file formats that I use to store clouds of points is simple
> ASCII xyz, one point per line, in the form
> 
> x[0]  y[0]  z[0]
> x[1]  y[1]  z[1]
> ....
> 
> You can simply read and convert these to binary using, for example,
> C++ STL iostreams tools.
> 
> The procedure to visualize the points it's like the following,
> assuming you have read nump points in the vector of floats pointed to
> by pp:
> 
> ----------------
> 
> vtkPoints* newp= vtkPoints::New();
> vtkCellArray* newv= vtkCellArray::New();
> vtkPolyData* pd= vtkPolyData::New();
> pd->SetPoints( newp );
> pd->SetVerts( newv );
> 
> while( nump-- > 0 )
> {
>    vtkIdType id= newp->InsertNextPoint( *pp++ );
>    newv->InsertNextCell( 1, &id );
> }
> 
> vtkPolyDataMapper* mapper= vtkPolyDataMapper::New();
> vtkActor* actor= vtkActor::New();
> mapper->SetInput( pd );
> actor->SetMapper( mapper );
> 
> ----------------
> 
> Once done this, you have to put the created actor in a Renderer
> instance in order to view the points in a render window.
> 
> HTH.
> 
> Bob
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail



More information about the vtkusers mailing list