[vtkusers] Smoothing

Hank Childs childs3 at llnl.gov
Wed Feb 25 11:32:39 EST 2004


> so instead of doing
>
> Mapper->SetScalarModeToUseCellData();
> myPolyData->GetCellData()->SetScalars(myFloatArray);
>
> I should do
> myPolyData->GetPointData()->SetScalars(myFloatArray);

First you want to make sure that "myFloatArray" is properly sized -- there 
are likely a different number of points and cells in your dataset.

> But won't I just see a bunch of particles then? i.e. a bunch of colored
> dots??  How do I get it to interpolate between teh dots and fill in the
> whole polydata?

You are trying to define a field on a surface.  A common way of doing this is 
by setting up "key" points along the surface and then doing interpolation 
between those key points.  By using point data, you are merely specifying the 
field by specifying the values at a set of key points -- the vertices that 
define your polygons.  A combination of VTK (when operating on those fields) 
and graphics hardware (when rendering those fields) will do the work of 
interpolating the values between those points.

So:
You're still dealing with the same surface.  Point data means that the 
variable you are storing on that surface is defined at the points that 
compose that surface.  The rest of the surface (not located at the points) is 
still defined; its values are calculated by interpolating the values of its 
neighboring points. 

Best,
Hank




More information about the vtkusers mailing list