//import org.j3d.renderer.aviatrix3d.loader.*; import org.j3d.aviatrix3d.*; import javax.vecmath.*; import java.awt.Color; import java.awt.color.ColorSpace; class cAviatrix { static Matrix4d tempmat = new Matrix4d(); static Object3D Read(Node s) { if (s == null) return new Object3D("NULL"); if (s instanceof Group) return Read((Group)s); if (s instanceof SharedGroup) return Read(((SharedGroup)s).getChild(0)); if (s instanceof Shape3D) return Read((Shape3D)s); if (s instanceof SharedNode) return Read(((SharedNode)s).getChild()); System.out.println("Unknown node class : " + s.getClass().getName()); //new Exception().printStackTrace(); return new Object3D(s.getClass().getName()); } static Object3D Read(Group g) { //if (g instanceof SharedGroup) //return Read(((SharedGroup)g).getChild(0)); Composite c = new Composite(g.getClass().getName()); if (g instanceof TransformGroup) { ((TransformGroup)g).getTransform(tempmat); if (c.toParent == null) { c.toParent = LA.newMatrix(); c.fromParent = LA.newMatrix(); } FillMatrix(tempmat, c.toParent); LA.matInvert(c.toParent, c.fromParent); } for (int i=0; i= 3; bRep.AddFace(indexV, indexV+1, indexV+2); indexF++; //bRep.faces.addElement(null); //bRep.setFace(indexF++, indexV, indexV+1, indexV+2); indexV += 3; for (int j=3; j