[vtkusers] vtkVertexGlyphFilter display issue

Alex Southern mrapsouthern at gmail.com
Thu Aug 5 07:25:19 EDT 2010


Hi,

Im trying to display a very large number of points, except for dome 
reson the points are not visible, can somebody help me with this?

double dx = some number;

// Assign Points to vtkPoints list
     vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();

     for (int k = 0; k < H; k++)
     {
         for (int j = 0; j < W; j++)
         {
             for (int i = 0; i < L; i++)
             {
                 points->InsertNextPoint((i*dx),(j*dx),(k*dx));
             }
         }
     }

     // Use the points to form poly data
     vtkSmartPointer<vtkPolyData> pointsPolydata = 
vtkSmartPointer<vtkPolyData>::New();
     pointsPolydata->SetPoints(points);

     vtkSmartPointer<vtkVertexGlyphFilter> vertexGlyphFilter = 
vtkSmartPointer<vtkVertexGlyphFilter>::New();
     vertexGlyphFilter->AddInput(pointsPolydata);
     vertexGlyphFilter->Update();

     vtkPolyData* vertexPolyData = vertexGlyphFilter->GetOutput();

     vtkSmartPointer<vtkPolyDataMapper> meshMapper = 
vtkSmartPointer<vtkPolyDataMapper>::New();
     meshMapper->SetInput(vertexPolyData);

     vtkSmartPointer<vtkActor> meshActor = vtkSmartPointer<vtkActor>::New();
     meshActor->SetMapper(meshMapper);

      // The renderer and interactor have been setup correctly elsewhere....
     ren1->AddActor(meshActor);
     iren->Render();



More information about the vtkusers mailing list