Importing a 3D Model
in
Contributed Library Questions
•
6 months ago
I have been trying to import models from various sources (Google warehouse, OBJ free model sites) to no avail. The supplied examples work but anytime I try to import my own from another source I get a slew of errors.
For trying to load using Collada files, I downloaded the specific Google Sketch version(8.0.3117) loaded a model into it and then exported it to .dae or .kzm for trying to import and both were unable to work. This is the error I am currently getting:
- Exception in thread "Animation Thread" java.lang.RuntimeException: cooladaLoader.ColladaLoaderException: Google SketchUp 8.0.3117
- throwed by a java.lang.NullPointerException
- at jogamp.common.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
- at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:99)
- at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:205)
- at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
- at javax.media.opengl.Threading.invoke(Threading.java:191)
- at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:461)
- at processing.opengl.PGL.requestDraw(PGL.java:1195)
- at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1550)
- at processing.core.PApplet.run(PApplet.java:2140)
- at java.lang.Thread.run(Thread.java:662)
- Caused by: cooladaLoader.ColladaLoaderException: Google SketchUp 8.0.3117
- throwed by a java.lang.NullPointerException
- at cooladaLoader.xmlMapping.Triangles.hasTexture(Triangles.java:73)
- at cooladaLoader.xmlMapping.ColladaRawLoader.assembleTriangles(ColladaRawLoader.java:117)
- at cooladaLoader.xmlMapping.ColladaRawLoader.<init>(ColladaRawLoader.java:34)
- at cooladaLoader.LoadingHelper.<init>(LoadingHelper.java:43)
- at cooladaLoader.LoadingHelper.<init>(LoadingHelper.java:61)
- at cooladaLoader.ColladaLoader.<init>(ColladaLoader.java:31)
- at cooladaLoader.ColladaLoader.getInstance(ColladaLoader.java:46)
- at SusanOnWall.setup(SusanOnWall.java:35)
- at processing.core.PApplet.handleDraw(PApplet.java:2241)
- at processing.opengl.PGL$PGLListener.display(PGL.java:3240)
- at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:573)
- at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:558)
- at javax.media.opengl.awt.GLCanvas$6.run(GLCanvas.java:1049)
- at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1021)
- at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
- at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:1060)
- at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
- at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)
- at java.awt.EventQueue.access$400(EventQueue.java:81)
- at java.awt.EventQueue$2.run(EventQueue.java:627)
- at java.awt.EventQueue$2.run(EventQueue.java:625)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
- at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)
- at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
- at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
- at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
- at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
- at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
- at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I also have tried OBJ loader by importing the files in Blender and exporting as OBJ models and get an error as well.
- draw mode: TRIANGLES
- Loading this = falling.obj
- Loading this = untitled.mtl
- java.lang.ArrayIndexOutOfBoundsException: 2
- at saito.objloader.OBJModel.parseOBJ(OBJModel.java:864)
- at saito.objloader.OBJModel.load(OBJModel.java:577)
- at saito.objloader.OBJModel.<init>(OBJModel.java:124)
- at sketch_3D.setup(sketch_3D.java:34)
- at processing.core.PApplet.handleDraw(PApplet.java:2241)
- at processing.opengl.PGL$PGLListener.display(PGL.java:3240)
- at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:573)
- at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:558)
- at javax.media.opengl.awt.GLCanvas$6.run(GLCanvas.java:1049)
- at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1021)
- at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
- at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:1060)
- at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
- at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)
- at java.awt.EventQueue.access$400(EventQueue.java:81)
- at java.awt.EventQueue$2.run(EventQueue.java:627)
- Obj Name: FallingWater_Support1.004_ID4686
- V Size: 14
- Vt Size: 14
- at java.awt.EventQueue$2.run(EventQueue.java:625)
- Vn Size: 0
- G Size: 1
- S Size: 0
- at java.security.AccessController.doPrivileged(Native Method)
- at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
- at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)
- at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
- at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
- at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
- at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
- at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
- OBJBoundingBox - Getting the Bounding Box
- at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
If anyone could help me it would be much appreciated.
1