Login  Register

Re: Loading and drawing .obj models

Posted by diskhub on May 08, 2011; 2:15am
URL: https://forum.jogamp.org/Loading-and-drawing-obj-models-tp2708428p2914191.html

I am trying to load the obj...
It did load but there's a problem...
after loaded the obj file,
it gives me this:


POLYGON COUNT FOR MODEL=252
VERTEX COUNT FOR MODEL=236
TEXTURE COORDINATE COUNT FOR MODEL=292
NORMAL COUNT FOR MODEL=275
Exception in thread "AWT-EventQueue-0" java.nio.BufferOverflowException
        at java.nio.DirectFloatBufferU.put(Unknown Source)
        at java.nio.FloatBuffer.put(Unknown Source)
        at prac4.WavefrontObjectLoader_DisplayList.ConstructTNV(WavefrontObjectLoader_DisplayList.java:203)
        at prac4.WavefrontObjectLoader_DisplayList.ConstructInterleavedArray(WavefrontObjectLoader_DisplayList.java:173)
        at prac4.WavefrontObjectLoader_DisplayList.drawModel(WavefrontObjectLoader_DisplayList.java:285)
        at prac4.WavefrontObjectLoader_DisplayList.loadWavefrontObjectAsDisplayList(WavefrontObjectLoader_DisplayList.java:306)
        at prac4.Test.init(Test.java:120)
        at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:155)
        at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:175)
        at javax.media.opengl.awt.GLCanvas$InitAction.run(GLCanvas.java:856)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:356)
        at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:769)
        at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:388)
        at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:487)
        at sun.awt.RepaintArea.paintComponent(Unknown Source)
        at sun.awt.RepaintArea.paint(Unknown Source)
        at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(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)