[vtkusers] Question using vtkHedgeHog
Vidya Raghavan
vidya_raghavan at hotmail.com
Tue Sep 21 23:34:12 EDT 2004
Dear VTK Users,
I am having trouble displaying surface normals on a 3D model. Basically,
when I use vtkHedgeHog in my code, I see only the 3D model being displayed
but not the normals. The code snippet below shows where I'm calling
vtkHedgeHog and adding the actor to the renderer. Am I doing something
wrong? I realized in the HedgeHog example from the textbook, the code
example uses the reader vtkStructuredPointsReader, but I get an error using
that and I need to use vtkXMLPolyDataReader to read my model data.
Please help!
Thanks,
-vidya
----------------------------------------------------------------------------------------------------------------------------------------
foreach tissue {1} {
# write the models to file
selectTissue ThresholdBetween $tissue $tissue
writer SetFileName model$tissue.vtk
writer Write
#create readers, mappers, and actors
vtkXMLPolyDataReader reader$tissue
reader$tissue SetFileName model$tissue.vtk
vtkHedgeHog hhog
hhog SetInput [reader$tissue GetOutput]
hhog SetScaleFactor 0.3
vtkLookupTable lut
lut Build
vtkPolyDataMapper hhogMapper
hhogMapper SetInput [hhog GetOutput]
hhogMapper SetScalarRange 50 550
hhogMapper SetLookupTable lut
hhogMapper ImmediateModeRenderingOn
vtkActor hhogActor
hhogActor SetMapper hhogMapper
vtkPolyDataMapper mapper$tissue
mapper$tissue SetInput [reader$tissue GetOutput]
vtkProperty prop$tissue
prop$tissue SetDiffuseColor [math Random] [math Random] [math Random]
prop$tissue SetSpecularPower 50
prop$tissue SetSpecular .5
prop$tissue SetDiffuse .8
vtkActor actor$tissue
actor$tissue SetMapper mapper$tissue
actor$tissue SetProperty prop$tissue
ren AddActor actor$tissue
ren AddActor hhogActor
}
_________________________________________________________________
All the news that matters. All the gossip from home.
http://www.msn.co.in/NRI/ Specially for NRIs!
More information about the vtkusers
mailing list