Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3
  ignore  |  Print  
  Announcing: joglutils project  (Read 51969 times)
0 Members and 1 Guest are viewing this topic.
Offline rodgersgb

Senior Newbie





« Reply #30 - Posted 2008-02-27 15:29:31 »

I finally made my updates...I was stuck for a couple of days on loading models/textures from jar files or from a directory and I think I put in a stop gap measure for now that seems to work pretty well.  Once I clean it up in my own code I'll have to put that update in this main one as well...either way, right now you can load directly from a jar file or from a directory on your computer.

I made updates to most of the files and I tried to keep the old code in place (commented out) and put the new code near it. 

This code still doesn't work for EVERY 3DS model, but it works on significantly more...I think some of the failures are not because of the loader per se but how the read in data is handled.  Right now the data is handled very naively...meaning, the code assumes a required texture exists and if one is missing then it will fail to display the model and possibly have a null pointer exception. Things like that will be fixed with time.

I updated the test3ds package as well to include a viewer that fits the model to the view, and adds a mouse handler to rotate the view and adds a simple light, etc.

I uploaded the changed files with the PATCH I made, but for those without access to those files that would like to try out my fixes you can get them from here:

    http://www.zaczek.com/joglutils/ThreeDS.zip - Updated 3DS loader code.
    http://www.zaczek.com/joglutils/test3ds.zip - Updated viewer
    http://www.zaczek.com/joglutils/models.zip - some free/sample 3DS models (including the original globe.3ds)

Now I need to go figure out how to preserve the models/textures in the context so that I don't have to reload them when resizing the screen....using GLJPanel for my own project and this is a big issue.

Z - I am the developer who originally put the 3ds loader code in the joglutils library. Myself and Brian Wood, has since made lots of changes to it. I would like to go through your code and merge it with the changes we have made. One big change with the loader is that the model has been abstracted from a specific model type implementation (whether it is a 3ds, obj, etc. implementation). The loader does support the obj format now and has the ability to support many more. There are still several areas that need work.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #31 - Posted 2008-02-27 17:04:46 »

Z - I am the developer who originally put the 3ds loader code in the joglutils library. Myself and Brian Wood, has since made lots of changes to it. I would like to go through your code and merge it with the changes we have made. One big change with the loader is that the model has been abstracted from a specific model type implementation (whether it is a 3ds, obj, etc. implementation). The loader does support the obj format now and has the ability to support many more. There are still several areas that need work.

that's fine...definitely go review it.  I guess I don't understand what you are trying to say right now though...I've not changed the abstraction of the code update I gave you (though I could be wrong). Mainly I fixed a lot of bugs that didn't allow me to load most 3DS models I had...heck even the globe.3ds model was incorrectly textured because the texture was being placed upside down on it (needed to do an AffineTransform on the texture).  The other fixes included some incorrect manipulation of bytes, incorrect calculation of normals, and there was something wrong with textures or materials (I can't recall which right now) being associated with objects when the 3DS spec says that they are associated with faces. 

As a comparison of the updates, I would recommend trying to load any of the 3DS models that I included and you'll notice that many won't be able to be read by the original code but are now possible with the updates.  I know I still have some things wrong but I hope I made enough improvements (hopefully didn't break anything) that this could be useful for you. 

Thanks for putting this code out there in the first place...holy cow this saved me a lot of time.  I'd also be very interested in what other loaders are being added...VRML would be a nice one since I have some models in that format.
Offline rodgersgb

Senior Newbie





« Reply #32 - Posted 2008-02-27 18:50:29 »

that's fine...definitely go review it.  I guess I don't understand what you are trying to say right now though...

I'm saying that I'm going to merge your changes with the ones I have made, then update the source in the repository.

I've not changed the abstraction of the code update I gave you (though I could be wrong).

I've made it a bit more abstract and easier to use.

Mainly I fixed a lot of bugs that didn't allow me to load most 3DS models I had...heck even the globe.3ds model was incorrectly textured because the texture was being placed upside down on it (needed to do an AffineTransform on the texture).  The other fixes included some incorrect manipulation of bytes, incorrect calculation of normals, and there was something wrong with textures or materials (I can't recall which right now) being associated with objects when the 3DS spec says that they are associated with faces.

As far as the upside down texture, I use opengl to flip the texture (part of my updates) as compared to java's AffineTransorm (not sure which one is more efficient  Huh). It looks like you were flipping it without checking to see if it needs it. "com.sun.opengl.util.texture.Texture" provides a method "getMustFlipVertically()" to see if it actually needs flipping.

As a comparison of the updates, I would recommend trying to load any of the 3DS models that I included and you'll notice that many won't be able to be read by the original code but are now possible with the updates.  I know I still have some things wrong but I hope I made enough improvements (hopefully didn't break anything) that this could be useful for you.

Thanks for putting this code out there in the first place...holy cow this saved me a lot of time.  I'd also be very interested in what other loaders are being added...VRML would be a nice one since I have some models in that format.

I hope I've addressed most of the issues that prevent any models from loading, but I will check the ones you mention. Hopefully with both our changes we can illuminate these cases.

Thank you for your work on this.

-greg rodgers
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Z-Knight

Senior Member


Medals: 1



« Reply #33 - Posted 2008-02-27 19:56:11 »

gotcha...maybe you caught some of the bugs I found, so that's good.  Also good info on the upsidedown texture issue, I'd be interested in seeing that fixed correctly so I can update my code. 

Btw, I did add two new classes that probably need some work...one was the ResourceRetriever that helps you load from either a jar or directory path, and the other was the Bounds class into the Three3D package to track the bounding box of the model....I hope that one still makes it into the package or maybe that could be abstracted higher for use with other loaders.

I can't wait for your corrections, it'll definitely be nice to have this loader fully functional.  I hope you also use some of the test3ds code I provided to allow the users to view the models better...or maybe improve on it because I'm relatively new to JOGL.  Have fun looking through my updates and if you have questions then let me know. Thanks.
Offline Chris61182

Junior Member





« Reply #34 - Posted 2008-02-27 20:01:04 »

I'm saying that I'm going to merge your changes with the ones I have made, then update the source in the repository.

Would you mind posting an update on here when you've updated the repository?

And thank you everyone for the work you've done, I look forward to seeing the results.
Offline rsantina

Junior Member





« Reply #35 - Posted 2008-02-28 11:38:42 »

MD3 is used for Quake 3. I thought you were interested in this, sorry to make you waste your time.

You might want to use Wavefront OBJ format (it can be exported from almost all 3D modeling tools including 3dsmax and maya). OBJ format is the simplest format to read and write to!
Offline Z-Knight

Senior Member


Medals: 1



« Reply #36 - Posted 2008-03-05 23:24:08 »

I would also appreciate anyone using the 3DS loader to contribute any suggestions as to how to improve frame rates with 3DS models.  I happen to have a 3DS model of the International Space Station which has probably 100,000 polygons/faces and when loading it in a 320x240 GLJPanel (I can't use GLCanvas) I get frame rates down in the teens (15 fps, etc) but when I remove the model I get frame rates of 40 fps or more.  I know this has to do with the large number of polygons in the model and I'm going to try to reduce those but I was also wondering if maybe the way I'm generating the call list or how I'm drawing the model itself is possibly causing the poor rates.  I'm not sure if there are any simple things I could try right of the bat or not?  In particular, the current way the model is being called is by generating the various OpenGL calls within a Call list and simply calling the list during the render process...is there something else more specific that I should also be doing...I believe this was the default behavior of the loader and test code...if not, then take a look at the code I attached a couple of posts above.

Thanks.
Offline jouvieje

Senior Newbie




Java games rock!


« Reply #37 - Posted 2008-03-10 22:44:45 »

Did you render your model with display lists ?
For my little experience rendering 3ds models, the highest frame rate I get is not with display list.
For 3ds models made of lot of different meshes and with high number of vertices, I generally got better results with vertex array (and even more with vbo).

Here is a result that may (or may not) be usefull for you : Direct Mode : ~3 fps; Display List : 4,5 fps; Vertex Array : 14 fps; Vertex Buffered Object (VBO) : 36 fps
I've made it with a 3ds model made of 500,000 vertices (ie 166,600 triangles), having 40 different materials in 560 meshes and displayed on a 1200x800 frame.


You can also optimize the model by :
 - sorting the meshes inside the model with the same material (ie same texture ...) and render them at the same time (ie in the same 'packet' of data)
 - pre-transform the meshes at loading time to save some possible glMultMatrix and a push/pop (sometimes there is a different transform for each meshes inside a model or a mesh hierarchy with multiple levels).
 - don't send unecessary datas (ie normal if no lighting is used ...).
 - ...

Tell me if that's usefull for you Wink

Offline Z-Knight

Senior Member


Medals: 1



« Reply #38 - Posted 2008-03-11 20:04:56 »

Did you render your model with display lists ?
For my little experience rendering 3ds models, the highest frame rate I get is not with display list.
For 3ds models made of lot of different meshes and with high number of vertices, I generally got better results with vertex array (and even more with vbo).

Here is a result that may (or may not) be usefull for you : Direct Mode : ~3 fps; Display List : 4,5 fps; Vertex Array : 14 fps; Vertex Buffered Object (VBO) : 36 fps
I've made it with a 3ds model made of 500,000 vertices (ie 166,600 triangles), having 40 different materials in 560 meshes and displayed on a 1200x800 frame.


You can also optimize the model by :
 - sorting the meshes inside the model with the same material (ie same texture ...) and render them at the same time (ie in the same 'packet' of data)
 - pre-transform the meshes at loading time to save some possible glMultMatrix and a push/pop (sometimes there is a different transform for each meshes inside a model or a mesh hierarchy with multiple levels).
 - don't send unecessary datas (ie normal if no lighting is used ...).
 - ...

Tell me if that's usefull for you Wink

Thanks Jerome for the response and the suggestions. I do use display lists because that is all I know of OpenGL at the moment and so I will have to investigate your suggestions.  The FPS for the example model you note are spectacular.  The main thing that I'm currently loading is a model of the International Space Station (ISS) that was based on CAD drawings and originally in VRML format which I converted to 3DS.  As such, the model contains many polygons even though it is only a low fidelity model of the ISS...it contains 38381 faces, 10112 meshes and 74557 vertices with 256 materials (based on your Model Viewer info).  In your Model Viewer I get a frame rate of about 30 FPS but in my display (320x240) when I simply display a textured Earth, moon, stars and sun I get an rate of 38 fps, when I make visible the model that I loaded I get 11 fps...that is a horrible drop - though I believe I must be doing something else poorly given that I have such a poor frame rate (38 fps) with just the 2 planets and stars and sun for that small of a window.  (running on a Pentium 4 3.20 GHz, 2 GB of RAM, ATI Radeon X1650 XT crappy video card (256mb))

I'd like to add one more thing...Jerome has been quite helpful in answering many of my questions on the 3DS loader topic in the past and I used his exceptional 3DS loader to help diagnose the issue with the joglutils loader.  In particular the ability of his loader to display all of the nodes, faces, normals, etc from within the viewer he has helped me figure out what the joglutils loader was reading incorrectly and where.  Thank you very much....for those interested, here is a link to Jerome's site:  http://jerome.jouvie.free.fr/index.php  If you go to his OpenGL Projects (Project 3) you can also use his model loader/viewer.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #39 - Posted 2008-03-11 20:11:15 »

I have encountered a problem with JOGL rc7 and rc8....I cannot run the net.java.joglutils.test3ds.Main under anything but rc6 because with rc7 and rc8 I get an exception:
   
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
Exception in thread "Thread-2" javax.media.opengl.GLException: java.lang.RuntimeException: java.lang.IllegalArgumentException: argument type mismatch
        at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:410)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
        at com.sun.opengl.util.Animator.display(Animator.java:144)
        at com.sun.opengl.util.Animator$MainLoop.run(Animator.java:181)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: argument type mismatch
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:86)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:52)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:189)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:83)
        ... 14 more
[glow=red,2,300]Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Attempt to make the same context current twice on thread[/glow] Thread[AWT-EventQueue-0,6,main]
...
...
   


Initially I thought it was having to do with Main.java accidentally having 'frame.add(canvas)' twice (I didn't do that...it was there to begin with) but removing one of those lines has not helped....does anyone know the issue here?  It must have to do with GLCanvas because I use GLJPanel in my own code with JOGL rc8 adn rc7 and it works perfectly fine.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
    public static void main(String[] args)
    {
        Frame frame = new Frame();
        GLCanvas canvas = new GLCanvas();
        Renderer renderer = new Renderer();
       
        MouseHandler inputMouseHandler = new MouseHandler(renderer);
   canvas.addMouseListener(inputMouseHandler);
   canvas.addMouseMotionListener(inputMouseHandler);
       
        canvas.addGLEventListener(renderer);
[glow=red,2,300][b]//        frame.add(canvas);[/b][/glow]
       frame.add(canvas);
        frame.setSize(600, 600);
        final Animator animator = new Animator(canvas);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
              // Run this on another thread than the AWT event queue to
             // make sure the call to Animator.stop() completes before
             // exiting
             new Thread(new Runnable() {
                  public void run() {
                    animator.stop();
                    System.exit(0);
                  }
                }).start();
            }
          });
        frame.setVisible(true);
        animator.start();
    }


The code compiles fine but this happens at runtime...I'm pretty sure I have my classpath and library paths setup correctly because, as I said, it runs fine for my other codes that use GLJPanel and even use the joglutils code and it runs perfectly fine in rc6.  Sorry I didn't check this sooner with rc7 when I submitted my update to joglutils.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jouvieje

Senior Newbie




Java games rock!


« Reply #40 - Posted 2008-03-11 23:17:15 »

Quote from: Z-Knight
I'd like to add one more thing...Jerome has been quite helpful in answering many of my questions on the 3DS loader topic in the past and I used his exceptional 3DS loader to help diagnose the issue with the joglutils loader.  In particular the ability of his loader to display all of the nodes, faces, normals, etc from within the viewer he has helped me figure out what the joglutils loader was reading incorrectly and where.  Thank you very much....for those interested, here is a link to Jerome's site:  http://jerome.jouvie.free.fr/index.php  If you go to his OpenGL Projects (Project 3) you can also use his model loader/viewer.

Thanks  Smiley
Also, just in case that someone could be interested, there is also a (new) utility for map edition : Map/World Editor (Project 5). I've starten this tool just few times ago, but it grows a little day-by-day. For more informations, just visit my pages.

Offline Ken Russell

JGO Coder




Java games rock!


« Reply #41 - Posted 2008-03-12 10:20:01 »

I have encountered a problem with JOGL rc7 and rc8....I cannot run the net.java.joglutils.test3ds.Main under anything but rc6 because with rc7 and rc8 I get an exception:

My best guess is that you're throwing an exception out of your display callback and JOGL isn't releasing the OpenGL context. Can you check to see if that's the problem?

Sorry I haven't had time to integrate your changes to the joglutils project yet. I'm swamped with work on the new Java Plug-In.
Offline rodgersgb

Senior Newbie





« Reply #42 - Posted 2008-03-12 14:21:23 »

Would you mind posting an update on here when you've updated the repository?

And thank you everyone for the work you've done, I look forward to seeing the results.

Yes, I should have all the updates in by this weekend. I've been swamped lately.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #43 - Posted 2008-03-12 18:16:18 »

My best guess is that you're throwing an exception out of your display callback and JOGL isn't releasing the OpenGL context. Can you check to see if that's the problem?

Sorry I haven't had time to integrate your changes to the joglutils project yet. I'm swamped with work on the new Java Plug-In.

Nope, I don't have any exceptions that are being thrown from my display callback...though wouldn't I see this same issue if I was in JOGL rc6 if I was having an exception?
I'm seeing this issue in any code that uses GLCanvas (as in the test3ds.Main) code...and I'm not even talking about the updated code that I submitted because this happens on the original joglutils test code that has none of my updates.

This is only happening on rc7 and rc8 of JOGL and I'm definitely not smart enough to figure out what the issue is...it even happens if I turn off all of the joglutils calls.
Here is some sample code where I've completely stripped everything out...I mean everything is gone and i'm basically creating a GLCanvas() and starting the Animator and that is it....note that if I replace the GLCanvas() with a GLJPanel() it runs fine in rc6 and rc8.   GLCanvas() runs fine in rc6 but throws the exception below in rc8.

Be aware that I have not messed with GLCanvas() recently so I don't know if any of this code is correct....though this is the stripped down joglutils test code (Main.java)...I probably should start a separate thread because it appears not to be a joglutils issue which I thought it was at first.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
import com.sun.opengl.util.Animator;
import java.awt.Frame;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLJPanel;
import javax.swing.*;
import java.awt.*;

public class Main {
   
    public Main() { }

    public static void main(String[] args) {        
        GLCanvas canvas = new GLCanvas();
        //GLJPanel canvas = new GLJPanel();
       
        Frame frame = new Frame();        
        frame.add(canvas);
       
        final Animator animator = new Animator(canvas);
       
        frame.setVisible(true);
        animator.start();
    }
}


Exception thrown by GLCanvas() version in rc8:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
OpenGL pipeline enabled for default config on screen 0
exception in QueueFlusher:
java.lang.RuntimeException: java.lang.IllegalArgumentException: argument type mismatch
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:86)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:52)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:189)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:83)
        ... 7 more
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
        at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:131)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
..
..
repeats
..
..
Offline rodgersgb

Senior Newbie





« Reply #44 - Posted 2008-03-13 01:20:19 »

Nope, I don't have any exceptions that are being thrown from my display callback...though wouldn't I see this same issue if I was in JOGL rc6 if I was having an exception?
I'm seeing this issue in any code that uses GLCanvas (as in the test3ds.Main) code...and I'm not even talking about the updated code that I submitted because this happens on the original joglutils test code that has none of my updates.

This is only happening on rc7 and rc8 of JOGL and I'm definitely not smart enough to figure out what the issue is...it even happens if I turn off all of the joglutils calls.
Here is some sample code where I've completely stripped everything out...I mean everything is gone and i'm basically creating a GLCanvas() and starting the Animator and that is it....note that if I replace the GLCanvas() with a GLJPanel() it runs fine in rc6 and rc8.   GLCanvas() runs fine in rc6 but throws the exception below in rc8.

Be aware that I have not messed with GLCanvas() recently so I don't know if any of this code is correct....though this is the stripped down joglutils test code (Main.java)...I probably should start a separate thread because it appears not to be a joglutils issue which I thought it was at first.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
import com.sun.opengl.util.Animator;
import java.awt.Frame;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLJPanel;
import javax.swing.*;
import java.awt.*;

public class Main {
   
    public Main() { }

    public static void main(String[] args) {        
        GLCanvas canvas = new GLCanvas();
        //GLJPanel canvas = new GLJPanel();
       
        Frame frame = new Frame();        
        frame.add(canvas);
       
        final Animator animator = new Animator(canvas);
       
        frame.setVisible(true);
        animator.start();
    }
}


Exception thrown by GLCanvas() version in rc8:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
OpenGL pipeline enabled for default config on screen 0
exception in QueueFlusher:
java.lang.RuntimeException: java.lang.IllegalArgumentException: argument type mismatch
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:86)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:52)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:189)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:83)
        ... 7 more
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
        at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:131)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
..
..
repeats
..
..


Just out of curiosity, disable the java2d opengl pipe line when running with the canvas. I know it used to not matter, but I see that you have it enabled when you don't need it.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #45 - Posted 2008-03-14 08:06:54 »

I think you may be using mismatched versions of jogl.jar and jogl.dll.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #46 - Posted 2008-03-17 17:41:12 »

I think you may be using mismatched versions of jogl.jar and jogl.dll.
I think it it was my damn path variable in windows that still had rc6 instead of rc8.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #47 - Posted 2008-04-07 22:20:28 »

any updates on how my fixes have been received?  well, I hope  Wink
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #48 - Posted 2008-04-12 10:29:37 »

As one of the joglutils project owners I'm sorry I haven't helped push this through...but I note that rodgersgb is a Developer on the 3ds portion and intended to put it in earlier. rodgersgb, can you take care of this?

Otherwise, Z-Knight, please apply for a Developer role (assuming you're comfortable using Subversion) and I'll approve it so you can check in your changes directly.
Offline gouessej
« Reply #49 - Posted 2008-04-12 10:45:19 »

Finally, which loaders will JOGLUtils contain? I see it already contains a 3DS loader. Is it planned to provide a OBJ loader and a MD3 loader? What about adding a minimal scenegraph, something lighter than in Java 3D?

Offline rodgersgb

Senior Newbie





« Reply #50 - Posted 2008-04-13 16:12:28 »

any updates on how my fixes have been received?  well, I hope  Wink

Yes, I left a lot of your code in (good job). I've been real busy at work and got behind on finishing up the merge and posting it. I think I will go ahead and post what I have for now.

Finally, which loaders will JOGLUtils contain? I see it already contains a 3DS loader. Is it planned to provide a OBJ loader and a MD3 loader? What about adding a minimal scenegraph, something lighter than in Java 3D?

Right now it supports 3DS and OBJ. The OBJ loader is not fully implemented yet because I ran into some problems with the way the Object mesh is defined. The OBJ format is much more bloated than 3DS. I think that coming up with a good scenegraph would fix these issues. It would also allow a way to handle LOD.
Offline rodgersgb

Senior Newbie





« Reply #51 - Posted 2008-04-17 04:03:20 »

Ken, we you get a chance can you create a folder named "model" under net.java.joglutils (net.java.joglutils.model) so I can upload new code?

Thanks.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #52 - Posted 2008-04-17 07:36:44 »

Added. Let me know if there is anything else you need me to do.
Offline rodgersgb

Senior Newbie





« Reply #53 - Posted 2008-04-18 04:23:30 »

Added. Let me know if there is anything else you need me to do.


I don't have write permission to the folder.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #54 - Posted 2008-04-19 18:50:19 »

I don't know how permissions to write to sub-portions of the repository work so I've added both you and Z-Knight as Developers. Let me know if you need anything else, and please be careful to not break anything in the repository.
Offline rodgersgb

Senior Newbie





« Reply #55 - Posted 2008-04-29 22:14:51 »

I don't know how permissions to write to sub-portions of the repository work so I've added both you and Z-Knight as Developers. Let me know if you need anything else, and please be careful to not break anything in the repository.


Thanks Ken, I have no intentions of going outside of the model package you added for me.

I have put all my code in the net.java.joglutils.model package. The loader supports 3ds and obj (not fully implemented yet).

Z-Knight, if you're not happy with the citations I put in there for you, by all means change it. I appreciate the work you did on the 3DS portion.
Offline Chris61182

Junior Member





« Reply #56 - Posted 2008-04-30 03:04:39 »

I appreciate the work you did on the 3DS portion.

We all do, even if we haven't had an opportunity to test it out yet  Smiley.
Offline Z-Knight

Senior Member


Medals: 1



« Reply #57 - Posted 2008-05-01 23:36:16 »

Citations are not important to me as long as the loader/viewers work for me and everyone else.  Glad to have helped.  I've not tested the new version since I'm still working with the old layout in my own code but I will as soon as I get some time.  Thanks for the updates and the new obj loader start.
Offline vinodpatel2006

Junior Member





« Reply #58 - Posted 2008-05-05 07:44:39 »

I have downloaded same .3ds from the net and tried to load it using joglutils. Programs runs without no error but does not shows any scene in the window.
Offline rodgersgb

Senior Newbie





« Reply #59 - Posted 2008-05-06 19:20:45 »

same .3ds from the net

Huh

If you will post a link to the 3ds file I will try it out.
Pages: 1 [2] 3
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (35 views)
2014-07-24 01:59:36

Riven (34 views)
2014-07-23 21:16:32

Riven (22 views)
2014-07-23 21:07:15

Riven (26 views)
2014-07-23 20:56:16

ctomni231 (56 views)
2014-07-18 06:55:21

Zero Volt (48 views)
2014-07-17 23:47:54

danieldean (39 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!