Tuesday, February 1, 2011

JOGL and SpringThing3D

I'm making some updates to SpringThing:
  • Make it an option to use OpenGL (JOGL) instead of Java2D.
  • JOGL web deployment
  • Make it fully 3D
  • 3D picking
  • 3D meshing and model building tools
  • Ability to save files
  • Signed applet

This'll be a record of progress and how to do these things.

JOGL Deployment
JOGL is plauged by fragmentation typical of the post~2003 Java JRE. There have been waves of attempts to make it deployable, and the latest is via a JNLP script. Don't use com.sun.openg
l.util.JOGLAppletLauncher, it doesn't work. All support about it is from ~2007 and is obviously not maintained. I'm implementing JNLP now based on this working example (no longer working after one week, new one is here) and JOGL-1.1.1a. You only need this file from the 1.1.1a distro.

Getting a JOGL plugin for NetBeans that claims to support applets here.

After a half day of struggle, found that I hadn't added the GLCanvas to the applet, so that's why init() and display() were not being called.

Now I've got a displaying GLCanvas in my applet, and I'm working on getting it to do something other than display a random glarg of VRAM.

Ok, it was because I was trying to change line widths inside a glBegin(gl.GL_LINES) - glEnd() block. With those removed it now shows a blank black screen, which makes me feel the need to reframe the view to show all entities. Update: that didn't fix it! My VRAM was just all blank so it looked ok. Back to flixering mayhem again, drawing board.

To develop and test this, I'm uploading the JAR, JNLP and HTML file set to my server and visiting the HTML which launches the JNLPAppletLoader. It is laborious but the best compromise I could come up with that verfies the deployment. You could setup a local JNLP file that had references to the local JAR, but I'd rather have 100% deployment verification, and I'm not sure the local JNLP would work. As a side note, opening the JNLP on my computer launches my remotely hosted applet just like a Java Web-Start application (in it's own window, no browser) which is very cool!

I find myself doing little things to improve the code I had, instead of debugging this stupid VRAM dump I'm getting. I just need to trace the logic of the JOGL demos (again...) and find out wtf I'm doing differently. Ok. Gonna do that now that my command console has awesome text fading.

This page was hard to find, but maybe there's a clue in here? He's show'in some scarambled graphics alright.

No comments:

Post a Comment