Oops! Dumb error in that last test example. I was printing out the
values of the old TriangleArray, not the new one. Code should have been:

import javax.media.j3d.*;

public class ThirdJ3DTest {

   public static void main(String[] args) {

      int n = 3;
      float[] coords = new float[n];
      coords[0] = 1.2345f;
      coords[1] = 9.9998f;
      coords[2] = 0.0054f;
      TriangleArray ta = new TriangleArray(n,
GeometryArray.COORDINATES);
      ta.setCoordinates(0, coords);
      ProxyTriangleArray pta = new ProxyTriangleArray();
      pta.setTriangleArray(ta);
      FileSerializer2 ser = new FileSerializer2();
      ser.saveObject(pta, "triangleArray.test");

      ProxyTriangleArray pta2 =
(ProxyTriangleArray)ser.loadObject("triangleArray.test");
      TriangleArray ta2 = pta2.getTriangleArray();
      System.out.println(ta2);
      n = ta2.getVertexCount();
      System.out.println("Vertex count = " + n);
      float[] f = new float[n];
      ta2.getCoordinates(0, f);
      for (int i=0; i<f.length; i++) {
         System.out.println("f[" + i + "] = " + f[i]);
      }
   }
}

Andrew

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