[vtkusers] vtkDecimatePro Problem
"한종철"
madness78 at pusan.ac.kr
Wed Jun 13 08:45:28 EDT 2007
I'm graduated student from South Korea.
While looking for the data for vtk, I found this page.
Can I have a question?
I have just started vtk for my project.
In vtk, there are four kinds of mesh simplication and now I'm trying to do it.
This is the simple source from book.
void main()
{
vtkPolyDataReader *part = vtkPolyDataReader::New();
part ->SetFileName("C:/VTK/vtkdata/Data/fran_cut.vtk");
vtkDecimatePro *deci = vtkDecimatePro::New();
deci -> SetInputConnection (part-> GetOutputPort());
deci -> SetTargetReduction( 0.9);
deci -> PreserveTopologyOn();
vtkPolyDataNormals *normals =vtkPolyDataNormals::New();
normals-> SetInputConnection(part -> GetOutputPort());
normals -> FlipNormalsOn();
vtkPolyDataMapper *partMapper = vtkPolyDataMapper::New();
partMapper -> SetInputConnection(normals -> GetOutputPort());
vtkActor *partActor = vtkActor::New();
partActor -> SetMapper(partMapper);
partActor -> GetProperty() -> SetColor(1.0,0.49,0.25);
vtkRenderer *ren1 = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin -> AddRenderer (ren1);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren -> SetRenderWindow(renWin);
ren1 -> AddActor( partActor);
ren1 -> SetBackground (1 ,1, 1);
renWin -> SetSize (800, 800);
renWin -> Render();
vtkCamera *cam1 = vtkCamera::New();
cam1 -> SetClippingRange (0.0475572, 2.37786);
cam1 -> SetFocalPoint (0.052665, -0.129454 ,-0.0573973);
cam1 -> SetPosition (0.327637, -0.116299, -0.256418);
cam1 -> SetViewUp (-0.0225386, 0.999137, 0.034901);
ren1 -> SetActiveCamera(cam1);
iren -> Initialize();
iren->Start();
}
I tried many things, but I couldn't get decimated image.
Just, I could get Original Image.
What is the problem??
Please answer me.
Have a Nice day!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070613/5aa7ebfc/attachment.htm>
More information about the vtkusers
mailing list