[vtkusers] OpenGL rendering of marchingCubes filtered volume

Moreland, Kenneth kmorel at sandia.gov
Tue Sep 26 17:54:17 EDT 2006


Nope.  That won't work.  The points are not given in any particular
order.  Instead, they are indexed by cell arrays (which you get with the
GetVerts, GetLines, GetPolys, and GetStrips methods).

"The Visualization Toolkit" textbook and "VTK User's Guide" both talk
about the format of vktPolyData.  There are also numerous examples in
the VTK source code for building and using poly data.

-Ken

> -----Original Message-----
> From: vtkusers-bounces+kmorel=sandia.gov at vtk.org [mailto:vtkusers-
> bounces+kmorel=sandia.gov at vtk.org] On Behalf Of
> giuseppe.tommasone at tiscali.it
> Sent: Tuesday, September 26, 2006 7:45 AM
> To: vtkusers at vtk.org
> Subject: [vtkusers] OpenGL rendering of marchingCubes filtered volume
> 
> I solved my recent problem with getting a volume contour vertices (see
> my earlier messages) thanks to help from this mailing list, but i
still
> can't do what i really wanted to: when i filter
> vtkStructuredPointsReader's output with a vtkMarchingCubes filter, the
> output is rendered the right way by the vtk renderer, but when i do
the
> following:
> 
> //Store all the points in a vector
> fillVector(&pointsVector, marchingCubes->GetOutput()->GetPoints());
> 
> void display() {
>     glBegin(GL_TRIANGLES);
>     for(iterator it = pointsVector.begin(); it != pointsVector.end();
> it++) {
>         glVertex3f(/*points coordinates*/);
>     }
>     glEnd();
> }
> 
> the result isn't by far the same, even with backface removal and
> lighting enabled, even though if i render the points as GL_POINTS i
can
> see that the vertices are right...it looks like if the vertices are
> shuffled up and thus sequentially rendering them as triangles mixes up
> the lines...i tried sorting the vector, but it had no effect...so the
> question is: in which order are the vertices stored in GetPoints(),
and
> how can i render them via OpenGL?
> 
> Thanks in advance
> 
> Mattia Tommasone
> 
> 
> Naviga e telefona senza limiti con Tiscali
> Scopri le promozioni Tiscali adsl: navighi e telefoni senza canone
Telecom
> 
> http://abbonati.tiscali.it/adsl/
> 
> _______________________________________________
> 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





More information about the vtkusers mailing list