[vtkusers] Using vtkGlyph with vtkCurvatures
David Welch
dmwelch at engineering.uiowa.edu
Thu Mar 18 13:42:23 EDT 2010
I'm trying to visualize the curvature of a geodesic using vtkArrow and I
cannot figure out how to pass the normal vectors to vtkGlyph3D to orient and
scale the vectors appropriately. I've included my code below. Any
suggestions? Thanks!
...
vtkPolyDataNormals *pathNormals = vtkPolyDataNormals::New();
pathNormals->SetInputConnection( geodesicPath->GetOutputPort() );
pathNormals->SplittingOff();
pathNormals->Update();
vtkCurvatures *pathCurvature = vtkCurvatures::New();
pathCurvature->SetInputConnection( geodesicPath->GetOutputPort() );
pathCurvature->SetCurvatureTypeToGaussian();
pathCurvature->Update();
vtkPolyDataMapper *curvatureMap = vtkPolyDataMapper::New();
curvatureMap->SetInputConnection(pathCurvature->GetOutputPort());
vtkArrowSource *arrows = vtkArrowSource::New();
vtkGlyph3D *glyphs = vtkGlyph3D::New();
glyphs->SetInputConnection( 1, pathNormals->GetOutputPort() );
glyphs->SetInputConnection( 0, pathCurvature->GetOutputPort() );
glyphs->SetSourceConnection( arrows->GetOutputPort() );
glyphs->SetScaleModeToScaleByScalar();
glyphs->SetScaleFactor(5.0);
glyphs->SetVectorModeToUseNormal();
glyphs->SetColorModeToColorByScalar();
glyphs->OrientOn();
...
--
David Welch
Graduate Student
Dept. of Biomedical Engineering
University of Iowa
Lab: (319) 335-5279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100318/a72ad28c/attachment.htm>
More information about the vtkusers
mailing list