Hi,

can anybody tell my what�s wrong with this code:

if the matrix is 2 x 2 everything is alright but when it�s bigger I get the
exception:

java.lang.NullPointerException:
at
javax.media.j3d.GeometryArrayRetained.setCoordinates(GeometryArrayRetained.j
ava:1879)       at
javax.media.j3d.GeometryArray.setCoordinates(GeometryArray.java:934)    at
j3dtest.Plot.<init>(Plot.java, Compiled Code)   at
j3dtest.Matrix3dplot.createSceneGraph(Matrix3dplot.java:16)     at
j3dtest.Matrix3dplot.<init>(Matrix3dplot.java:27)       at
j3dtest.Matrix3dplot.main(Matrix3dplot.java:36)

what�s false?


double[][] matrix =
            {
                    {0.1,0.2,0.5},
                  {0.3,-0.4,0.6}
            };

Point3d[] vertices = new Point3d[TOTAL_NUM_OF_VALUES];

      for (int ROW = 0; ROW < SIZE_Y ; ROW++)
        {
          for (int COL = 0; COL < SIZE_X; COL++)


                int N = 0;
                    double stepsize = 0.5;
                vertices[N] = new Point3d(0,  matrix[ROW][COL], 0.0);
                N++
                    vertices[N] = new Point3d(0, matrix[ROW++][COL], 0.5);
                N++;
                vertices[N] = new Point3d(0, matrix[ROW][COL++], 0.0);
                N++;
                vertices[N] = new Point3d(0.5,matrix[ROW++][COL++], 0.5);
                N++;
                int[] StripCount = {vertices.length};
                // TriangleStripArray
                TriangleStripArray tsa = new TriangleStripArray(vertices.length,

GeometryArray.COORDINATES,
                                                                StripCount);
                tsa.setCoordinates(0, vertices);
                // Shape3D with TriangleStripInformationen
                Shape3D t = new Shape3D();
                t.setAppearance(createTriangleAppearance());
                t.setGeometry(tsa);
                mouse.addChild(t);
            }
          }
Thanks!

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to