[vtkusers] Question about using vtkGeometryFilter and vtkGlyph3D

Jong Youl Choi yyalli at gmail.com
Thu Aug 19 22:21:20 EDT 2010


Hi all,

I was trying to sub-select points in vtkPolyData by using
vtkGeometryFilter and draw glyphs for those only selected points
without success. A part of codes is as follows:

	vtkPolyData *plot = vtkPolyData::New();
	plot->SetPoints(points);
	plot->SetVerts(polys);
	plot->GetPointData()->SetScalars(scalars);

	// vtkGeometryFilter
	vtkGeometryFilter *subplot = vtkGeometryFilter::New();
	subplot->SetInput(plot);
	subplot->PointClippingOn();
	subplot->SetPointMinimum(0);
	subplot->SetPointMaximum(3);
	subplot->Update();

	// Glyph3D
	vtkSphereSource *sphere = vtkSphereSource::New();
	vtkGlyph3D *glyph = vtkGlyph3D::New();
	glyph->SetInput(subplot->GetOutput());
	glyph->SetSource(sphere->GetOutput());

Using vtkGeometryFilter works if I don't use vtkGlyph3D. For example,

	vtkPolyDataMapper *plotMapper = vtkPolyDataMapper::New();
	plotMapper->SetInput(subplot->GetOutput());

	vtkLODActor *plotActor  = vtkLODActor::New();
	plotActor->SetMapper(plotMapper);

	ren->AddActor(plotActor);

I will appreciate any advice or comment.

Thanks,
Jong

-- 
Jong Youl Choi
Dept. of Computer Science
Indiana University at Bloomington
Homepage: http://www.cs.indiana.edu/~jychoi



More information about the vtkusers mailing list