[vtkusers] Vertex presentation (scalability and visibility issues )

Alex Malyushytskyy alexmalvtk at gmail.com
Mon Apr 25 19:33:11 EDT 2011


I am trying to display some points on top of 3d mesh and I could not
find a reasonable way to achieve what I would like to.

First comments comments about what I would call ideal:
- vertex presentation should be drawn in pixels ( do not change size
during zoom )
- if vertex center is visible, vertex presentation should be fully visible.

As for now I found 2 ways to display vertex, but I failed to find a
way to achieve what I want with bot of them:

1. Vertex  as 3d cell (a sphere). This can be implemented in multiple
ways ( the way I tried was to use vtkGlyph3D ).
But all the ways suffer draw data as 3d data, which means rendering
and memory usage is inefficient.
t and even though location of the point  is displayed somehow clear
part of the presentation is hidden if point is displayed on top of
other cell (for example triangle ).
The only advantage of this method is that, if sphere is used as a
source for a glyph3d vertex presentation looks ok, if vertex center is
located  on the surface of another cell.

The major issue with this approach is that I could not find any way
("automatic scaling, etc"). I certainly could find a scale factor and
recreate spheres each time user zooms with different radius,  but  I
doubt that could be done without without killing the performance.

2. Vertex as 0d cell. I tried vtkVertexGlyphFilter.  This approach is
close to ideal, but suffer another major issue.
Vertex is presented as a 2d rectangle in screen coordinates.
Zooming in/out always shows desired size of the rectangle in pixels (
I would prefer it to be circle or frame as a shape, but can live with
it ).

Problems of this method are:
Vertex presentation is still rendered as 3d object. Assume the
previous example - vertex on the triangular surface.
Depending on the camera, part of the vertex rectangle is hidden behind
triangular surface.


Is there any alternative?

I remember when we were using hoops 3d  in one of the project we were
able to draw vertexes ( and other primitives) ourselves.
Once visibility of the primitive was established  (by hoops) we could
callback function was called and we could directly draw vertex
rectangle in 3d coordinates.
Can anything like this be achieved with vtk?

Thanks in advance,

Alex









should be displayed by drawing 2d primitive in screen coordinate system.



More information about the vtkusers mailing list