From: Michael G. <gof...@us...> - 2007-06-22 09:05:44
|
Update of /cvsroot/octave/octave-forge/extra/jhandles/src/org/octave/graphics In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14062/src/org/octave/graphics Modified Files: PatchObject.java Log Message: revert previous change to keep code mroe readble Index: PatchObject.java =================================================================== RCS file: /cvsroot/octave/octave-forge/extra/jhandles/src/org/octave/graphics/PatchObject.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- PatchObject.java 21 Jun 2007 22:29:04 -0000 1.5 +++ PatchObject.java 22 Jun 2007 09:05:41 -0000 1.6 @@ -224,7 +224,7 @@ return null; int nv = v.length; - double[] n = new double[3*nv]; + double[][] n = new double[nv][3]; double[] vCount = new double[v.length]; int vIndex; @@ -236,11 +236,11 @@ Utils.crossProduct( v1[0]-vp[0], v1[1]-vp[1], v1[2]-vp[2], vc[0]-vp[0], vc[1]-vp[1], vc[2]-vp[2], - n, (int)f[i][1]-1, nv); + n[(int)f[i][1]-1]); Utils.crossProduct( v1[0]-vp[0], v1[1]-vp[1], v1[2]-vp[2], vc[0]-vp[0], vc[1]-vp[1], vc[2]-vp[2], - n, (int)f[i][0]-1, nv); + n[(int)f[i][0]-1]); vCount[(int)f[i][0]-1]++; vCount[(int)f[i][1]-1]++; for (int j=2; j<faceCount[i]; j++) @@ -250,7 +250,7 @@ Utils.crossProduct( vp[0]-vc[0], vp[1]-vc[1], vp[2]-vc[2], v1[0]-vc[0], v1[1]-vc[1], v1[2]-vc[2], - n, vIndex, nv); + n[vIndex]); vCount[vIndex]++; vp = vc; } @@ -259,13 +259,13 @@ { if (vCount[i] > 0) { - n[i+0*nv] /= vCount[i]; - n[i+1*nv] /= vCount[i]; - n[i+2*nv] /= vCount[i]; + n[i][0] /= vCount[i]; + n[i][1] /= vCount[i]; + n[i][2] /= vCount[i]; } } - return new Matrix(n, new int[] {nv, 3}); + return new Matrix(n); } double[][] getCData() |