fiji / 3D_Viewer

https://imagej.net/plugins/3d-viewer
GNU General Public License v3.0
20 stars 18 forks source link

3D Viewer fails when rotating/zooming on a multimesh that has a mesh with a list of zero triangles #2

Open ctrueden opened 10 years ago

ctrueden commented 10 years ago

From @acardona:

The error happens consistently when one of the meshes added to the MultiMesh is made of a list of empty triangles. Such mesh should either be refused from being added to the MultiMesh, or internally whatever computations go for estimating its bounding box etc. take the fact that it's empty into account.

At the moment, such empty triangle list is, I suspect, resulting into an inappropriate 3D affine transform for the MultiMesh object.

The exception below happens for example when trying to rotate such MultiMesh. And it's very consistent! Happens always.

I have observed these as of 2010-02-08; never before. I must comment here that I think I had never tried yet a CustomMultiMesh with an empty list of triangles inside.

For further proof, I git bisected to the last known version—and that version also failed. Then I realized that it was the CustomMultiMesh that I had crafted the one making the 3D Viewer fail.

Exception occurred during Behavior execution:
javax.media.j3d.BadTransformException: TransformGroup: non-affine transform
    at javax.media.j3d.TransformGroup.setTransform(TransformGroup.java:137)
    at ij3d.behaviors.ViewPlatformTransformer.rotateXY(ViewPlatformTransformer.java:312)
    at ij3d.behaviors.InteractiveViewPlatformTransformer.rotate(InteractiveViewPlatformTransformer.java:61)
    at ij3d.behaviors.InteractiveBehavior.doProcess(InteractiveBehavior.java:281)
    at ij3d.behaviors.InteractiveBehavior.processStimulus(InteractiveBehavior.java:104)
    at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:192)
    at javax.media.j3d.J3dThread.run(J3dThread.java:275)
Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => amd64
  os.name => Linux
  os.version => 2.6.31-19-generic
  java.version => 1.6.0_17
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_17-b04
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.3-b01
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => gnome
  file.separator => /

Migrated-From: http://fiji.sc/bugzilla/show_bug.cgi?id=138