I want to draw a cube using jMathPlot. The cube's points are:
(0,0,1),(1,0,1),(1,1,1),(0,1,1),(0,0,2),(1,0,2),(1,1,2),(0,1,2)
I have these variables:
double[] x = {0,1,0,1};
double[] y = {0,1,0,1};
double[][] z1 = {{1,1,2,2},
{2,2,1,1},
{1,1,2,2},
{1,1,2,2}};
Plot3DPanel plot = new Plot3DPanel("SOUTH");
plot.addGridPlot("cube", Color.red ,x, y, z1);
It doesn't work and honestly I still don't understand why z
must be a 2D array?
Any help would be appreciated.