Hi,<br><br>I'm rendering elevation data. Originally data is a structured grid and very dense. But looks fine. When I try to reduce number of polygons using vtkQuadricDecimation I loose all colors and get a gray scale image. I wonder why? What does decimation do to the data so that mapper cannot color it any more? <br>
<br>Btw. Using vtkDecimatePro solves the coloring problem. But the question remains: why colors disappear when I use vtkQuadricDecimation? Why? <br><br>The pipeline I use is below. (No smart pointers, I know. It's a sample and easier to read, when not using smart pointers). It works just fine if I skip quadric decimation.<br>
<br>Thanks,<br><br>Olli<br><br><br> vtkImageImport* reader = vtkImageImport::New();<br> // import settings<br> // ...<br> reader->Update();<br><br> vtkDataSetSurfaceFilter* filter = vtkDataSetSurfaceFilter::New();<br>
filter->SetInputConnection(reader->GetOutputPort());<br> reader->Delete();<br> filter->ReleaseDataFlagOn();<br> filter->Update();<br><br> vtkWarpScalar* warp = vtkWarpScalar::New();<br> warp->SetInputConnection(filter->GetOutputPort());<br>
filter->Delete();<br> warp->SetScaleFactor(3);<br> warp->Update();<br><br> vtkQuadricClustering* cluster = vtkQuadricClustering::New();<br> cluster->SetInputConnection(warp->GetOutputPort());<br>
warp->Delete();<br> cluster->AutoAdjustNumberOfDivisionsOff();<br> cluster->SetNumberOfDivisions(240, 240, 10);<br> cluster->PreventDuplicateCellsOn();<br> cluster->UseInputPointsOn();<br> cluster->Update();<br>
<br> vtkQuadricDecimation *dec=vtkQuadricDecimation ::New();<br> dec->SetInputConnection(cluster->GetOutputPort());<br> cluster->Delete();<br> dec->SetTargetReduction(.80);<br> dec->Update();<br>
<br> // color map for terrain<br> vtkColorTransferFunction* lut = vtkColorTransferFunction::New();<br> lut->AddHSVSegment(1, 0.3, 0.7, 0.7, 2000, 0.1, 0.7, 0.7); // terrain<br> lut->AddHSVPoint(0, 0.667, 0.7, 1); // sea level<br>
<br> vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();<br> mapper->SetInputConnection(dec->GetOutputPort());<br> dec->Delete();<br> mapper->ScalarVisibilityOn();<br> mapper->SetScalarRange(0, 1000);<br>
mapper->SetLookupTable(lut);<br> lut->Delete();<br> mapper->Update();<br> ...<br>