views:

208

answers:

3

Hi! I need your help.

I'm working on a 3D chart in Java using Java 3D. It should be able to display a bunch of measured values. As measured, the data I get is scattered. This means I will have to interpolate the missing points in order to get my surface plotted nicely.

I didn't study all that 3D-Geometry stuff yet and I don't know where to start. My idea is to triangulate the points to a surface and then, based on the triangulation, interpolate the missing points. (see this to have a rough idea of what I want to achieve)

Does someone have experiences with the interpolation of scattered data? Is my approach the right one? If yes, what kind of data structures and algorithms will I need in order to triangulate my points cloud?

+1  A: 

You need to use an interpolation function, basically it takes your data points as input and will return a z value for any (x,y).

For instance you can use a spline interpolation, as implemented in apache commons math

Guillaume
+1: Thank you for telling me about the existence of a Java Math API :)
Simon
+1  A: 

Triangulation is very fast if you need to do a lot of interpolation on a large data irregular dataset, for example, contouring a ground surface. The interpolation is linear and discrete, based solely on the three points of the triangle in which you are interpolating. In also supports constraints such as break lines, e.g. think of a ground surface defined by points that includes a line defining a ridge or cliff.

Splines give a smoother result across all the input, but can be very slow on larger data sets and may give unusual results on poorly spaced data. You may also want to look up NURBS (a type of spline surface) and Bezier patches.

Shane MacLaughlin
Thank you for your hints. Are there any free APIs able to do that? I don't only need to display an interpolated surface. I need the interpolated surface points in memory so that I can pass the to my plotter, which is "only" able to plot functions for which any x,y,z values for each grid point are defined.
Simon
For triangulation in Java, try http://www.cs.bgu.ac.il/~benmoshe/DT/Delaunay%20Triangulation%20in%20Java.htm Googling Java triangulation also gives plenty of results. I'm a C++ hack myself, so couldn't comment of how good or bad any of these implementations are.
Shane MacLaughlin
A: 

If you don't want the burden of triangulating, you may want to look at kriging or radial basis function interpolation.

Alexandre C.