[vtkusers] Fwd: an odd question about a plate which behind the actor
David Doria
daviddoria+vtk at gmail.com
Thu Apr 1 08:21:09 EDT 2010
---------- Forwarded message ----------
From: 朱文武 <cool.wenwu at gmail.com>
Date: Wed, Mar 31, 2010 at 10:11 PM
Subject: Re: [vtkusers] an odd question about a plate which behind the actor
To: David Doria <daviddoria+vtk at gmail.com <daviddoria%2Bvtk at gmail.com>>
David,
Thanks! sorry, i also do not know why the image was disappeared. I
don't know whether the problem is related to the code. Because the same code
can applied in other images(dataset), and the problem did not occurred. The
related code was presented:
m_read = new vtkBMPReader();
skinExtractor = vtkMarchingCubes::New();//
skinNormals = vtkPolyDataNormals::New();//
triangle=vtkTriangleFilter::New();//
deci=vtkDecimatePro::New();/
smoother=vtkSmoothPolyDataFilter::New();//
skinMapper = vtkPolyDataMapper::New();//
skin = vtkActor::New();
this->m_read->Update();//read the bmp image
this->skinExtractor->SetInputConnection(m_read->GetOutputPort());
this->skinExtractor->SetValue(0,threshshold);
this->skinNormals->SetInputConnection(skinExtractor->GetOutputPort());/
this->skinNormals->SetFeatureAngle(60.0);//
this->triangle->SetInputConnection(skinNormals->GetOutputPort());//
this->deci->SetInputConnection(triangle->GetOutputPort());//
this->deci->SetTargetReduction(predigestion);//
this->deci->PreserveTopologyOn();//
this->smoother->SetInputConnection(deci->GetOutputPort());//
this->smoother->SetNumberOfIterations(smoothness);//
this->skinMapper->SetInputConnection(smoother->GetOutputPort());//
this->skinMapper->ScalarVisibilityOff();//
this->skinMapper->SetColorModeToMapScalars();
this->skinMapper->SetScalarRange(-1,1);
// Link the actor
this->skin->SetMapper(this->skinMapper);
this->skin->GetProperty()->SetColor(0.94,0.83,0.45);
The image of the result:
[image: 5.bmp]
Thanks!
Please keep the discussion on the mailing list so everyone can benefit/help.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100401/6ba1de8d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/bmp
Size: 47300 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100401/6ba1de8d/attachment.bin>
More information about the vtkusers
mailing list