|
Patheros
|
 |
« on: 25. March 2007, 06:15:49 am » |
|
So I just updated my Xith checkouts, it was maybe 2 days old and I'm now getting a weird NPE. I can't seem to reproduce it in any of the tests so far. Here is the exception: java.lang.NullPointerException at org.xith3d.scenegraph.GeometryArray.getTexCoordData(GeometryArray.java:166) at org.xith3d.render.jsr231.ShapeAtomPeer.checkTexCoordOptimizationUsage(ShapeAtomPeer.java:853) at org.xith3d.render.jsr231.ShapeAtomPeer.renderAtom(ShapeAtomPeer.java:1011) at org.xith3d.render.CanvasPeer.renderAtom(CanvasPeer.java:667) at org.xith3d.render.jsr231.CanvasPeerImplBase.drawBin(CanvasPeerImplBase.java:516) at org.xith3d.render.jsr231.CanvasPeerImplBase.renderMain(CanvasPeerImplBase.java:930) at org.xith3d.render.jsr231.CanvasPeerImplBase.display(CanvasPeerImplBase.java:1100) at org.xith3d.render.jsr231.CanvasPeerSwingImpl.display(CanvasPeerSwingImpl.java:437) at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78) at javax.media.opengl.GLJPanel$Updater.display(GLJPanel.java:952) at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78) at com.sun.opengl.impl.GLPbufferImpl$DisplayAction.run(GLPbufferImpl.java:215) at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194) at com.sun.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(GLPbufferImpl.java:201) at com.sun.opengl.impl.GLPbufferImpl.display(GLPbufferImpl.java:88) at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:594) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source) at javax.swing.JComponent.paintDoubleBuffered(Unknown Source) at javax.swing.JComponent._paintImmediately(Unknown Source) at javax.swing.JComponent.paintImmediately(Unknown Source) at javax.media.opengl.GLJPanel$PaintImmediatelyAction.run(GLJPanel.java:1124) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #1 on: 25. March 2007, 01:11:49 pm » |
|
How did you create your Shape3D/Geometry? I suspect, you create it with the wrong features (GeometryArray.COORDINATES, etc.). Though this should not have this effect.
Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Patheros
|
 |
« Reply #2 on: 25. March 2007, 02:40:39 pm » |
|
First the OBJLoader test, as in the SVC, is missing a model Exception in thread "main" java.io.FileNotFoundException: C:\Andrew\Evocosim\eclipse workspace\xith-tk\demo\models\jeep.obj (The system cannot find the file specified) Second I found the problem. One of my OBJ models seems to cause the NPE exception. I've attached the obj file and mtl file of the model thats causing problems.
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #3 on: 25. March 2007, 02:50:10 pm » |
|
First the OBJLoader test, as in the SVC, is missing a model
Thanks. I've added it. Seems like Eclipse ignores ".obj" files by default. One more argument, that it was not a very good idea by the Wavefront guys o use ".obj" as their file extension  . Second I found the problem. One of my OBJ models seems to cause the NPE exception.
I've attached the obj file and mtl file of the model thats causing problems.
Thanks. I will check it in an hour or two. Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Patheros
|
 |
« Reply #4 on: 25. March 2007, 02:52:43 pm » |
|
Thanks. I've added it. Seems like Eclipse ignores ".obj" files by default. One more argument, that it was not a very good idea by the Wavefront guys o use ".obj" as their file extension  . Yeah, its annoying. Thanks. I will check it in an hour or two.
Thanks a lot Marvin.
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #5 on: 25. March 2007, 05:41:38 pm » |
|
The model file doesn't seem to be the problem. I've loaded it in OBJLoaderTest and it works without problems.
I guess, you're aware of the fact, that there aren't any testure coordinates in the OBJ file? Though this would/should also not cause such problems.
Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Patheros
|
 |
« Reply #6 on: 25. March 2007, 09:45:10 pm » |
|
I guess, you're aware of the fact, that there aren't any testure coordinates in the OBJ file? Though this would/should also not cause such problems.
I found the problem. It was the missing texture coords. The model file I was actually using was a little out of date compared to the one I put online. That one did try to apply a texture. Thanks.
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
|
'n ddrylliog
|
 |
« Reply #7 on: 26. March 2007, 04:34:20 pm » |
|
These exceptions need to be made more explicit. (e.g. before the e.printStackTrace(), maybe a Sysout.println("Hey ! We've found null texture coordinates... It's really a problem and we can't continue. Are you sure they're contained in your OBJ model ? Please double-check and ask help on forums if everything seems alright from your side."))
Okay maybe that's over-assistance, but..
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #8 on: 26. March 2007, 06:26:20 pm » |
|
These exceptions need to be made more explicit. (e.g. before the e.printStackTrace(), maybe a Sysout.println("Hey ! We've found null texture coordinates... It's really a problem and we can't continue. Are you sure they're contained in your OBJ model ? Please double-check and ask help on forums if everything seems alright from your side."))
Okay maybe that's over-assistance, but..
The point is, that no-texture-coorinates are no problem for an OBJ file. I was able to load Patheros' model without any exception. Marvin
|
|
|
|
|
Logged
|
|
|
|
|
'n ddrylliog
|
 |
« Reply #9 on: 27. March 2007, 04:31:57 pm » |
|
The point is, that no-texture-coorinates are no problem for an OBJ file. I was able to load Patheros' model without any exception.
OK so what was the problem at all ??
|
|
|
|
|
Logged
|
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #10 on: 27. March 2007, 05:25:44 pm » |
|
OK so what was the problem at all ??
The problem is simply, that this caused an exception for Patheros. Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Patheros
|
 |
« Reply #11 on: 27. March 2007, 07:30:13 pm » |
|
I feel something got lost communication.
The model I uploaded was NOT the model causing the problems. It was a different version of the model and I mistakenly uploaded it instead of the actual model. The problem model had the same obj file but a different mtl file. The different mtl file tried to apply a texture to the model. Something must have changed in cvs so that this problem started causing an exception. Is that clear to you two?
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #12 on: 27. March 2007, 07:50:21 pm » |
|
I feel something got lost communication.
The model I uploaded was NOT the model causing the problems. It was a different version of the model and I mistakenly uploaded it instead of the actual model. The problem model had the same obj file but a different mtl file. The different mtl file tried to apply a texture to the model.
Oh, yes, you said that. If the problematic model still causes such problems, could you maybe provide the it as a testing object? Something must have changed in cvs so that this problem started causing an exception.
SVN  . Yes, definitely. Marvin
|
|
|
|
|
Logged
|
|
|
|
|
Patheros
|
 |
« Reply #13 on: 27. March 2007, 08:25:25 pm » |
|
Oh, yes, you said that. If the problematic model still causes such problems, could you maybe provide the it as a testing object?
The problem with the problematic model (as you pointed out) is that it had no texture vertex data and the mtl file at the time was trying to apply a texture. What do we want Xith to do in this case? It we want a NPE in the geometry array, then Xith already does this perfectly.
|
|
|
|
|
Logged
|
"I like my method, what was my method again?" - Jon
|
|
|
Marvin Fröhlich
Xith Lord
Administrator
Guru
   
Offline
Posts: 4381
May the 4th, be with you...
|
 |
« Reply #14 on: 27. March 2007, 08:39:35 pm » |
|
Oh, yes, you said that. If the problematic model still causes such problems, could you maybe provide the it as a testing object?
The problem with the problematic model (as you pointed out) is that it had no texture vertex data and the mtl file at the time was trying to apply a texture. What do we want Xith to do in this case? It we want a NPE in the geometry array, then Xith already does this perfectly. Hmm... I think, the Loader should indeed throw a more declarative exception. Somthing like org.xith3d.loaders.models.IncorrectFormatException with some kind of descriptive text. But it would be a little work. Marvin
|
|
|
|
|
Logged
|
|
|
|
|