Hi there,

I'm getting this error which is a huge problem as it completely kills my
application and I don't know what to do. Submission deadline for my work
is in just under 2 weeks and this is the last major problem I have. I
can greatly limit my program to 4 internal frames to avoid this bug, but
this is not at all desirable.

STACKTRACE
java.lang.ArrayIndexOutOfBoundsException
        at
javax.media.j3d.GeometryArrayRetained.getDlistTimeStamp(GeometryArrayRet
ained.java:7682)
        at
javax.media.j3d.RenderBin.updateDlistCanvasResource(RenderBin.java:768)
        at javax.media.j3d.RenderBin.updateObject(RenderBin.java:633)
        at
javax.media.j3d.MasterControl.updateMirrorObjects(MasterControl.java:236
7)
        at
javax.media.j3d.MasterControl.runMonitor(MasterControl.java:2975)
        at javax.media.j3d.MasterControl.doWork(MasterControl.java:2592)
        at
javax.media.j3d.MasterControlThread.run(MasterControlThread.java:28)

INFO / BACKGROUND
This part of my program is in the form of MDI application with MenuBar
and ToolBar with a JDesktopPane for a load of JInternalFrames which
contain a canvas 3D.

I find that is I add more than 4 internal frames, the entire application
crashes / locks up giving that stacktrace with no reason I can find.. I
guess that it might be a bug in java3d as a result of me approchign the
problem in the wrong way.

For each JInternalFrame I have added a Canvas3D. Each Canvas3D has a
separate SimpleUniverse associated with it and the MouseBehaviors for
rotate and zoom are attached to the single main BranchGroup. Onto each
branchgroup I draw "myObject".

This is where the problem arises by adding my complicated object into
the universe on the canvas.

I've done some testingon the content of the JinternalFrames
If I just create them and add a simple JLabel to the frames.. I can keep
creating > 50 frames ad inifintum*

If I do         frame.getContentPane().add(new
javax.media.j3d.Canvas3D(null));     blank canvas3d I can open 32frames
and I get error on the 33rd frame.  The following also happens when I
add a canvas3d with a simple universe.

Exception occurred during event dispatching:
java.lang.InternalError
        at
javax.media.j3d.MasterControl.getCanvasBit(MasterControl.java:836)
        at javax.media.j3d.Canvas3D.addNotify(Canvas3D.java:1071)
        at java.awt.Container.addNotify(Container.java:1586)
        at javax.swing.JComponent.addNotify(JComponent.java:4015)
        at java.awt.Container.addNotify(Container.java:1586)
        at javax.swing.JComponent.addNotify(JComponent.java:4015)
        at java.awt.Container.addNotify(Container.java:1586)
        at javax.swing.JComponent.addNotify(JComponent.java:4015)
        at javax.swing.JRootPane.addNotify(JRootPane.java:483)
        at java.awt.Container.addNotify(Container.java:1586)
        at javax.swing.JComponent.addNotify(JComponent.java:4015)
        at java.awt.Container.addImpl(Container.java:377)
        at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:201)
        at java.awt.Container.add(Container.java:231)
        at organix.ui.RenderFrame.openAction(RenderFrame.java:401)
//  jDesktopPane.add(f);
        at organix.ui.RenderFrame.access$0(RenderFrame.java:374)
        at
organix.ui.RenderFrame$13.actionPerformed(RenderFrame.java:223)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractB
utton.java:1504)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.ja
va:378)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonList
ener.java:216)
        at java.awt.Component.processMouseEvent(Component.java:3717)
        at java.awt.Component.processEvent(Component.java:3546)
        at java.awt.Container.processEvent(Container.java:1167)
        at java.awt.Component.dispatchEventImpl(Component.java:2595)
        at java.awt.Container.dispatchEventImpl(Container.java:1216)
        at java.awt.Component.dispatchEvent(Component.java:2499)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2458)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2223)
        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2132)
        at java.awt.Container.dispatchEventImpl(Container.java:1203)
        at java.awt.Window.dispatchEventImpl(Window.java:918)
        at java.awt.Component.dispatchEvent(Component.java:2499)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:336)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea
d.java:134)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.
java:101)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)

NEXT !!!
I create JInternalFrames, with universe, with 1 default sphere  (new
Sphere()) in the main BranchGroup
Again I can only get 32 internalFrames before the crash.

FINALLY!!!
If I create my full objects as shown in the *picture attached* I get a
crash after only 4 frames

SPECS:
Hardware: 512Mb, 650MHz Athlon, 40Gb Hard Drive, 32Mb GeForce 256
(Asus),
Software: Detonator drivers v 5.13.01.1241, Java3D (OpenGL) v1.2.1_01,
JDK 1.3.0_01, Windows2000 v5.00.2195 Pro (SP2)

SOME CODE:
  private void createOrganix(Group objRoot) {   // test organix
      Transform3D transform = new Transform3D();
      Appearance app = createAppearance();

      for (int i=0, total = 100; i < total; i++) {
          transform.setTranslation(new Vector3f(
             (float)Math.sin(i*4*Math.PI / total),
             (float)Math.cos(i*4*Math.PI / (total)),
             (float)Math.cos(i*2*Math.PI / (total))));
          TransformGroup transGroup = new TransformGroup(transform);
          Sphere blob = new Sphere(0.3f, Sphere.GENERATE_TEXTURE_COORDS
|
          Sphere.GENERATE_NORMALS, 20, app);

          transGroup.addChild(blob);
          objRoot.addChild(transGroup);
      }
  }

If anyone could shed any light on what is going wrong as I  haven't a
clue, I'd be very grateful.  If you want to help and need more code I
can always email more. Thanks

In complete despair,
Spencer Goh
~~~~~~~~~~~~~~~~~~~~~~~~
Postgraduate
Computer Science
University of Birmingham, UK
07747 600 436
www.spencergoh.com
[EMAIL PROTECTED]

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