3ds loader: null pointer in SmoothGroupProcessor

Hi,

I’m using the latest xith-3ds loader available from the xith toolkit projects download page. Loading some models seem to cause a null pointer exception in the class org.newdawn.xith3d.threeds.SmoothGroupProcessor, in method calculateSurfaces at row 160:


159:        for (int i=0;i<normalCache.length;i++) {
160:            normalCache[i].normalize();
161:        }


The Jeep model loads fine, but some other 3ds files cause that exception (they all seem to use smoothed / gouraud shaded surfaces, in case that has anything to do with the error). I don’t have access to ftp upload at the moment, but can send the model by mail if needed.

Traceback:


java.lang.NullPointerException
      at org.newdawn.xith3d.threeds.SmoothGroupProcessor.calculateSurfaces(SmoothGroupProcessor.java:160)
      at org.newdawn.xith3d.threeds.SmoothGroupProcessor.process(SmoothGroupProcessor.java:64)
      at org.newdawn.xith3d.threeds.TDSLoader.processChunk(TDSLoader.java:132)
      at org.newdawn.xith3d.threeds.TDSLoader.load(TDSLoader.java:99)
      at org.worldforge.gamesystem.shape.Model3DSShapeFactoryLoader.loadShapeFactory(Model3DSShapeFactoryLoader.java:90)
...

Best regards,


zzorn

Have you got the latest version of the loader, I think we’ve done this one already.

If not, feel free to send the models over to me and I’ll try and take a look in the near future.

As a work around you might try flipping the flag for indexed geometry when you load.

Kev

I was using the xith-3ds-1 version from the xith tools download page earlier, but switched to the xith-3ds-2 version from the newdawn homepage now. However, it seems the same problem is still persisting.

I’m sending the model that is causing the exception to you Kev.

– zzorn