<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>to learn a little bit about vtk, I modified the very simple Vol.cxx
example which initializes
<br>a vtkStructuredPoints data set by setting
the origin, the spacings and the scalars like
<p> vtkStructuredPoints *vol = vtkStructuredPoints::New();
<br> vol->SetDimensions(26,26,26);
<br> vol->SetOrigin(-0.5,-0.5,-0.5);
<br> sp = 1.0/25.0;
<br> vol->SetSpacing(sp, sp, sp);
<br> vtkScalars *scalars = vtkScalars::New();
<br> :
<br> vol->GetPointData()->SetScalars(scalars);<br>
scalars->Delete();
<p> Then a contour is extracted and a nice isosurface is drawn on
the screen.
<br>
<br> Now, i just switched from StructuredPoints to RectilinearGrid,
and left everything else as it was:
<p> vtkRectilinearGrid *vol = vtkRectilinearGrid::New();
<br> vtkScalars *xx=vtkScalars::New() ;
<br> for (i=0; i<26; i++) xx->InsertScalar(i, ((float)i)/25 );
<br> vol->SetXCoordinates(xx);
<br> vol->SetYCoordinates(xx);
<br> vol->SetZCoordinates(xx);
<br> vtkScalars *scalars = vtkScalars::New();
<br> :
<br> vol->GetPointData()->SetScalars(scalars);<br>
scalars->Delete();
<p> In this case, NO ISOSURFACE was drawn on the
screen.
<br> Has anybody an idea what went wrong ?
<p> I suppose i missed something in the initialization of a
RectilinearGrid.
<p>regards
<br>Frank
<pre></pre>
</html>