[vtkusers] Problem with vtkDelaunay3D
burlen
burlen at apollo.sr.unh.edu
Fri Dec 14 14:54:56 EST 2007
You are seeing the surface of your object, I think what you are after is
either some sort of volume rendering, or to simply slice or sample the
data on the interior of your dataset. You can for instance slice the
data with a plane, or a spherical shell and visualize the resulting
surfaces. You might take a look at using paraview to try various
techniques before you bother coding anything up yourself.
John Ownsoul wrote:
> Dear Fellows,
>
> I want to visualize 3D geographical data with VTK. I use x,y,z resistivity
> values. I use vtkDelaunay3D and visualize it, but when zooming into the
> object i saw that it is not a solid object. The object is hollow. How can i
> visualize a solid object, could you help me. Thanks for everything...
>
>
> http://www.nabble.com/file/p14336625/1.jpg
> http://www.nabble.com/file/p14336625/2.jpg
>
>
>
> Here is my code:
>
> while (dis.available() != 0)
> {
> qwe++;
> temp=dis.readLine();
>
> processLine(temp);
> System.out.println("x : " + x + ", y : " + y + ", z : " + z + ",
> resist. : " + r );
> id1=points.InsertNextPoint(x,y,z);
> //if(r>20 && r<80) r=100;
>
> if (r>max) max=r;
> if (r<min) min=r;
>
> r=1-r/500;
>
> values.InsertValue(qwe,r);
> ids.InsertNextId(qwe);
> cell.InsertNextCell(id1);
> }
> fis.close();
> bis.close();
> dis.close();
> System.out.println(qwe);
> System.out.println("min " + min);
> System.out.println("max " + max);
>
> vtkPolyData polyData = new vtkPolyData();
> polyData.SetPoints(points);
> polyData.SetVerts(cell);
> polyData.GetPointData().SetScalars(values);
>
>
> //==============================================================
> vtkDelaunay3D del3D = new vtkDelaunay3D();
> del3D.SetInput(polyData);
> del3D.SetTolerance(0.001);
> del3D.BoundingTriangulationOff();
>
> vtkDataSetMapper dataSetMapper=new vtkDataSetMapper();
> dataSetMapper.SetInput(del3D.GetOutput());
> //==============================================================
>
> vtkActor actor = new vtkActor();
> actor.SetMapper(dataSetMapper);
> actor.GetProperty().SetColor(1,0,0);
>
>
>
>
> vtkRenderer renderer = new vtkRenderer();
> vtkRenderWindow renderWindow = new vtkRenderWindow();
> renderWindow.AddRenderer(renderer);
>
> vtkRenderWindowInteractor iren = new
> vtkRenderWindowInteractor();
> iren.SetRenderWindow(renderWindow);
>
> renderer.AddActor(actor);
> renderer.SetBackground(0,0,0);
>
> renderWindow.SetSize(600, 600);
> renderWindow.Render();
> iren.Initialize();
> renderWindow.Render();
> iren.Start();
>
>
> ====================================================================
> Here is my data set:
>
> x y z resistivity value
> ==== ==== ===== ============
> .....
> 2 1 -0.25 118.741
> 3 1 -0.25 128.561
> 4 1 -0.25 99.534
> 5 1 -0.25 179.084
> 6 1 -0.25 100.552
> 7 1 -0.25 60.644
> 8 1 -0.25 128.533
> 9 1 -0.25 78.901
> .......
>
> ====================================================================
>
More information about the vtkusers
mailing list