[vtkusers] vtk Coloring
Omar Al-Kofahi
alkofo at rpi.edu
Mon Apr 29 17:56:17 EDT 2002
Hi,
I created an iso-surface, and I was trying to color that iso-surface, but I
can't change the default color. I tried to set the actor's color, as well as
changing the light's color, nothing changed. The code used is attached
below. I keep getting BLUE color, no matter what I do.
Does any one of you know what should I do?
Thank you.
Omar
vtkStructuredPoints *StructuredPoints;
// Fill the StructuredPoints..
..
// Create the contours
vtkContourFilter *surfaces = vtkContourFilter::New();
surfaces->SetInput(StructuredPoints);
StructuredPoints->Delete();
surfaces->SetNumberOfContours(1);
surfaces->SetValue(0, 250);
surfaces->Update();
actor = vtkActor::New();
mapper = vtkPolyDataMapper::New();
mapper->SetInput(surfaces->GetOutput());
surfaces->Delete();
actor->SetMapper(mapper);
actor->GetProperty()->SetColor(1.0, 1.0, 1.0);
aren->AddActor(actor);
vtkRenderWindow* renWin = vtkRenderWindow::New();
renWin->AddRenderer(aren);
vtkLight *light = vtkLight::New();
light->SetLightTypeToCameraLight();
light->SetColor(1.0, 1.0, 1.0);
More information about the vtkusers
mailing list