AW: [vtkusers] vtkDecimatePro Problem

Erbacher, Markus Markus.Erbacher at med.uni-heidelberg.de
Wed Jun 13 08:47:47 EDT 2007


I think the mistake is in ine the line:
 normals-> SetInputConnection(part -> GetOutputPort());
 
it should be:
 normals-> SetInputConnection(deci -> GetOutputPort());
 
You just render the original, because you do not use the decimated mesh as input.




	-----Ursprüngliche Nachricht-----
	Von: vtkusers-bounces+markus.erbacher=med.uni-heidelberg.de at vtk.org [mailto:vtkusers-bounces+markus.erbacher=med.uni-heidelberg.de at vtk.org] Im Auftrag von madness78 at pusan.ac.kr
	Gesendet: Mittwoch, 13. Juni 2007 14:45
	An: vtkusers at vtk.org
	Betreff: [vtkusers] vtkDecimatePro Problem
	
	

	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!

	 

	 <http://webmail.pusan.ac.kr/cgi-bin/setconfirm.cgi?k=118173872858336050277&u=madness78&d=pusan.ac.kr> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070613/2f5ac907/attachment.htm>


More information about the vtkusers mailing list