[vtkusers] Help!!!I can't change the color of the iso face!

Lin Fei sophie_linfei at hotmail.com
Fri May 3 23:30:00 EDT 2002


Hi everybody,
    I'm using vtkMarchingCubes class to create some isofaces,but I can not 
change the color when rendering.I develop this in the example SampleMFC 
comes with VTK4.0.Here is a piece of my code in CSampleDoc:
	
         vtkStructuredPointsReader * reader = 
vtkStructuredPointsReader::New();
	reader->SetFileName("ironProt.vtk");

	vtkMarchingCubes * skinExtractor = vtkMarchingCubes::New();
	skinExtractor->SetInput(reader->GetOutput());
         skinExtractor->SetValue(0, 128);

	vtkPolyDataMapper *mapMC = vtkPolyDataMapper::New();
	mapMC->SetInput(skinExtractor->GetOutput(0));

	vtkActor *actMC = vtkActor::New();
	actMC->SetMapper(mapMC);
	actMC->GetProperty()->SetColor(1,1,0);//<==This line doesn't work at all.

	Props->AddItem(actMC);

    No matter what color I set,it's always blue.But if I render a 
vtkCubeSource object or something in the same program,it works.
    Any help will be highly appreciated!


Sophie
5/4/2002


_________________________________________________________________
免费下载 MSN Explorer:http://explorer.msn.com/lccn/intl.asp




More information about the vtkusers mailing list