When generating a 3D box, build with floor, walls and a ceiling i get
sometimes the following error:

java.lang.ArrayIndexOutOfBoundsException
        at com.sun.j3d.utils.geometry.Desperate.foundSplit(Desperate.java:316)
        at com.sun.j3d.utils.geometry.Desperate.existsSplit(Desperate.java:241)
        at com.sun.j3d.utils.geometry.Desperate.desperate(Desperate.java:65)
        at com.sun.j3d.utils.geometry.Triangulator.triangulate(Triangulator.java:496)
        at jcmodel.parts_v2.JCRuimte3D.polyBox(JCRuimte3D.java:115)

It happend in the code in the line "tr.triangulate(gi)" aftre the
inialization of the Triangulator class
/*
  * shaping the floor
  */
                nr = grondvlak.npoints ;
                Coords = new Point3f[nr];
                for(int i = 0; i < nr; i++)
                        Coords[i] = new Point3f((float)grondvlak.xpoints[i]/1000.0f    
                                         ,hoogte/1000.0f,
(float)grondvlak.ypoints[i]/1000.0f);
                coordinateIndices = new int[1];
                coordinateIndices[0] = nr;

                int[] contourCounts = new int[1];
                contourCounts[0] = coordinateIndices.length;

                GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
                        gi.setCoordinates( Coords );
                        gi.setStripCounts( coordinateIndices );
                        gi.setContourCounts( contourCounts);

                Triangulator tr = new Triangulator();
                        tr.triangulate(gi);
                NormalGenerator ng = new NormalGenerator();
                        ng.generateNormals( gi );
                Stripifier st = new Stripifier();
                        st.stripify( gi );

                vormpje = new Shape3D(gi.getGeometryArray(), 
createAppearance(objColor));
                vormpje.setCapability(Geometry.ALLOW_INTERSECT);
                totalShape .addChild( vormpje );

My question is what is going wrong and how can i correct its:
with regards
AANT

===========================================================================
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