[vtkusers] Decimating terrain meshes using vtkQuadricDecimation
Jingyi Jin
jinjingyi at yahoo.com
Fri Sep 28 21:59:08 EDT 2001
Hi,
I'm having trouble with the class
vtkQuadricDecimation, I would really appretiate if any
of you could shere with me your experience on this
filter and help me out in this problem.
I have terrain data in triangle meshes, when I apply
vtkQuadricDecimation filter to it, the terrain simply
disappears from the screen! I've tried to apply the
same filter to other polydatas, such as cone, sphere,
etc, it worked perfectly. But for planes or
high-fields, the object simply disappears.
I've spent too long time doing a project based on this
class, and only at the end found out this
disappointing feature... please help me if I am doing
something obviously incorrect.
The following was the code that I used to test the
filter:
vtkPlaneSource *plane= vtkPlaneSource::New();
plane->SetXResolution(20);
plane->SetYResolution(20);
vtkTriangleFilter *filter = vtkTriangleFilter::New();
filter->SetInput(plane->GetOutput());
vtkQuadricDecimation *deci =
vtkQuadricDecimation::New();
deci->SetInput(filter->GetOutput());
//deci->SetMaximumCost(6);
deci->SetMaximumCollapsedEdges(2);
vtkPolyDataMapper *coneMapper =
vtkPolyDataMapper::New();
coneMapper->SetInput(deci->GetOutput());
vtkActor *coneActor = vtkActor::New();
coneActor->SetMapper(coneMapper);
// assign our actor to the renderer
ren->AddActor(coneActor);
// draw the resulting scene
renWindow->Render();
Thank you very much. Have a good day.
Jingyi
__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com
More information about the vtkusers
mailing list