Hi John,<br>i dont know java so i can only provide some C++ code snips.<br>But i guess you can do something like this:<br><br>double x, y, z, value;<br>vtkIdList *ids = vtkIdList::New();<br>vtkPoints *points = vtkPoints::New();
<br>vtkDoubleArray *values = vtkDoubleArray::New();<br>values->SetNumberOfTuples(NumberOfPointsInDataset);<br>values->SetNumberOfComponents(1);<br>values->SetName("<span class="q">resistivity</span>");<br>
<br>for(i = 0; i < NumberOfPointsInDataset; i++)<br>{<br>  // Read your data into x, y and z coordiantes<br>  points->InsertPoint(i, x, y, z);<br><br>  //Read your  <span class="q">resistivity values<br>  values->InsertValue(i, value);
<br><br>  //Create point ids for the cells<br>  ids->InsertNextId(i);<br></span>}<br><br>// Build PolyData<br>vtkPolyData *poly = vtkPolyData::New();<br>poly->Allocate(NumberOfPointsInDataset);<br>poly->SetPoints(points);
<br>points->Delete();<br>poly->GetPointData()->SetScalars(values);<br>values->Delete();<br><br>//Now build the cells. You can build triangles if you know the order<br>//of your points. If you dont know the order than just create a PolyVertex cell to render the points in VTK
<br>//use the delaunay triangulator: to triangluate the data<br><br>poly->InsertNextCell(VTK_POLY_VERTEX, ids);<br>ids->Delete();<br>poly->Sqeeze();<br><br>//Now use the delaunay triangulator to triangulate the poly data set
<br>vtkDelaunay2d ....<br><br>//The code is untested and without any warranty :)<br><br>//END<br><br>References:<br><a href="http://www.vtk.org/doc/release/5.0/html/a01872.html">http://www.vtk.org/doc/release/5.0/html/a01872.html
</a><br><a href="http://www.vtk.org/doc/release/5.0/html/a01335.html">http://www.vtk.org/doc/release/5.0/html/a01335.html</a><br><a href="http://www.vtk.org/doc/release/5.0/html/a01867.html">http://www.vtk.org/doc/release/5.0/html/a01867.html
</a><br><a href="http://www.vtk.org/doc/release/5.0/html/a01322.html">http://www.vtk.org/doc/release/5.0/html/a01322.html</a><br><a href="http://www.vtk.org/doc/release/5.0/html/a01880.html">http://www.vtk.org/doc/release/5.0/html/a01880.html
</a><br><br>Best regards<br>Soeren<br><br><div><span class="gmail_quote">2007/10/11, John Ownsoul <<a href="mailto:mongwarrior@yahoo.com">mongwarrior@yahoo.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Soeran;<br><br>Thanks for your attention and help. I can write my own program to map the<br>geographical data to java. But, what must i do after than getting the values<br>and coordinates? Could you send me a sample code or a reference about this?
<br>Thanks again; (I want to use only java and vtk)<br><br>Best regards;<br><br>John Ownsoul<br><br><br><br><br><br><br><br><br>Soeren Gebbert-2 wrote:<br>><br>> Hi John,<br>> just an idea. If you have geographical data which you want to visualize
<br>> with<br>> vtk<br>> than try the combination of the gis grass and paraview. There are many<br>> options<br>> in grass to get your x,y,z ascii data into it. You can process the data<br>> there and export it with the grass module 
r.out.vtk into the vtk format to<br>> visualize<br>> the data with paraview, visit or mayavi.<br>><br>> Or you can build in java a poly dataset with x,y,z point coordinates<br>> connected with triangles to<br>
> each other and store the resistivity values in an point data double array.<br>> If you have<br>> an ordered point set the triangulation should be no problem.<br>> AFAIC you have to import the data with your own program. There is no
<br>> x,y,z,value import module in vtk. But im not sure.<br>><br>> Best regards<br>> soeren<br>><br>> Link to grass:<br>> <a href="http://grass.itc.it">grass.itc.it</a><br>><br>> Link to some grass/vtk modules and related stuff:
<br>> <a href="http://www-pool.math.tu-berlin.de/~soeren/grass/modules">www-pool.math.tu-berlin.de/~soeren/grass/modules</a><<a href="http://www-pool.math.tu-berlin.de/%7Esoeren/grass/modules">http://www-pool.math.tu-berlin.de/%7Esoeren/grass/modules
</a>><br>><br>> 2007/10/11, John Ownsoul <<a href="mailto:mongwarrior@yahoo.com">mongwarrior@yahoo.com</a>>:<br>>><br>>><br>>> Dear Fellows;<br>>><br>>> I have some data about a geographical surface, and i want to show an
<br>>> image<br>>> in VTK (with Java).<br>>> But i am a beginner, so i don't know the syntax very well. I practice<br>>> with<br>>> VTK, but i don't know the file operations. Could you help me to construct
<br>>> the file and show the image in vtk??<br>>><br>>> I use these datas at the below:<br>>><br>>> x(m)   y(m)   z(m)    resistivity value(ohm.m)<br>>> 2        1    -1,406           204,934
<br>>> 3        1    -1,406           108,021<br>>> 4        1    -1,406             62,275<br>>> 5        1    -1,406             47,608<br>>>                     ...<br>>><br>>><br>>> Thanks for everything...
<br>>><br>>> --<br>>> View this message in context:<br>>> <a href="http://www.nabble.com/About-constructing-a-3D-geographical-surface-tf4605431.html#a13150408">http://www.nabble.com/About-constructing-a-3D-geographical-surface-tf4605431.html#a13150408
</a><br>>> Sent from the VTK - Dev mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>>><br>>> _______________________________________________<br>>> vtk-developers mailing list<br>
>> <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>>><br>>
<br>> _______________________________________________<br>> vtk-developers mailing list<br>> <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">
http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>><br>><br><br>--<br>View this message in context: <a href="http://www.nabble.com/About-constructing-a-3D-geographical-surface-tf4605431.html#a13152207">http://www.nabble.com/About-constructing-a-3D-geographical-surface-tf4605431.html#a13152207
</a><br>Sent from the VTK - Dev mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________<br>vtk-developers mailing list<br><a href="mailto:vtk-developers@vtk.org">
vtk-developers@vtk.org</a><br><a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br></blockquote></div><br>