[vtkusers] vtkGlyph3D Colors

B.L.Kaptein at lumc.nl B.L.Kaptein at lumc.nl
Fri Feb 1 08:32:51 EST 2008


Hi,

I use vtkGlyph3D to display a large number of small spheres. With VTK4,
I could change the color of these spheres by changing the color of the
Actor itself, but with VTK5, all spheres remain blue and I cannot change
the color anymore. Can anybody explain to me how to fix this problem? Is
there some command like: SetColorModeToDataColoringOff()?????

-- CODE EXAMPLE -- 
vtkGlyph3D *MarkersGlypher = vtkGlyph3D::New();
MarkersGlypher->SetScaleModeToDataScalingOff();
MarkersGlypher->SetColorModeToColorByVector();
MarkersGlypher->SetInput(this->GetTransformFilter()->GetOutput());
MarkersGlypher->SetSource(Sphere->GetOutput());

vtkPolyDataMapper *MarkersMapper = vtkPolyDataMapper::New();
MarkersMapper->SetInput(ActiveMarkersGlypher->GetOutput());

vtkActor *MarkersActor = vtkActor::New();	
MarkersActor->SetMapper(MarkersMapper);

// This command does not change the color of the little spheres!
MarkersActor->GetProperty()->SetColor(Color);
-- END CODE --

Thanks,

Bart.



More information about the vtkusers mailing list