The graph3d package allows easy-to-implement and visually demanding display of explicitly defined and numerically evaluable functions using two or three floating point arguments.
The package provides a heavy weight UI component, graph3d.GraphView, which provides built-in support for basic model manipulation like zooming and rotating the graph on mouse-drag, and automatic fit on viewport resizes. The GraphView also provides an API, which allows selection of various display properties like pointset-, wireframe and smooth shading modes, lighting parameters etc.
To create a viewport for a function f(x,y) := x * y, the following code would
be required:
To pass functions to the GraphView, there are two different strategies
available,supported and indicated by usage of appropriate interfaces:
...
JFrame frame = new JFrame("Graph3d Test");
graph3d.GraphView view =
new graph3d.GraphView(
new graph3d.Function() {
public double call(double x,double y)
{
return x * y;
}
});
frame.getContentPane().add(view);
...
public class f implements graph3d.Function2 {
public double call(double x,double y)
{
...
}
}