After hours of debugging I having quite figured it out yet.  However, if I call GeometryInfo.compact() I don't get the exceptions anymore.  The geometry seems VERY quantized to the point were the gaps between surfaces are very noticeable.  I tried turning the coordQuant to 16, but that made no difference.
 
Could anyone tell me exactly what compact() does, why it keeps the exception from happening and if it may (or may not) be responsibly for the coordinate distortion?
 
Thanks,
 
Adam
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of Adam Tegen
Sent: Thursday, November 30, 2000 12:56 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Compressed geometry problems.

Hello-
 
I'm trying to use compressed geometry for J3d.  On some of the input, it works just find, and on some of it, it dies.  I have reduced the problem to the following piece of code:
 
save(GeometryInfo geomInfo)
{
    try
    {
        GeometryInfo[] geomInfos = new GeometryInfo[1];
        geomInfos[0] = geomInfo;
        CompressionStream cStream = new CompressionStream(positionQuant, colorQuant, normalQuant,geomInfos);
        GeometryCompressor comp = new GeometryCompressor();
        CompressedGeometry compGeom = comp.compress(cStream);
        /*immediately decompress to test it and I SOMETIMES get an exception*/
        compGeom.decompress();
        /*...*/
    }
 }
 
here is the Exception:
 java.lang.IllegalArgumentException: GeneralizedStrip: strip ended incompletely
 at javax.media.j3d.GeneralizedStrip.toStripsAndFans(GeneralizedStrip.java:277)
 at javax.media.j3d.GeneralizedStrip.toTriangleStrips(GeneralizedStrip.java:423)
 at javax.media.j3d.GeneralizedVertexList.toTriangleStripArray(GeneralizedVertexList.java:299)
 at javax.media.j3d.GeometryDecompressorShape3D.addShape3D(GeometryDecompressorShape3D.java:288)
 at javax.media.j3d.GeometryDecompressorShape3D.decompress(GeometryDecompressorShape3D.java:161)
 at javax.media.j3d.GeometryDecompressorShape3D.toTriangleStripArrays(GeometryDecompressorShape3D.java:97)
 at javax.media.j3d.CompressedGeometry.decompress(CompressedGeometry.java:290)
Does anybody have a clue?  Is this a bug?

Reply via email to