Font3D issues

I'm trying to utilize Font3D to display 3D text for the LoadingGameState and I'm running into a very strange issue.



I keep getting this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: initGVIDs
   at sun.font.SunLayoutEngine.initGVIDs(Native Method)
   at sun.font.SunLayoutEngine.<clinit>(SunLayoutEngine.java:83)
   at sun.font.GlyphLayout.get(GlyphLayout.java:168)
   at java.awt.Font.layoutGlyphVector(Font.java:2240)
   at com.jmex.font3d.Font3D.<init>(Font3D.java:82)
   at com.jmex.game.state.load.LoadingGameState.init(LoadingGameState.java:60)
   at com.jmex.game.state.load.LoadingGameState.<init>(LoadingGameState.java:52)
   at jmetest.game.state.TestLoadingGameState.main(TestLoadingGameState.java:47)



All I'm doing is this:

      Font3D font = new Font3D(new Font("Arial", Font.PLAIN, 2), 0.1, true, true, true);
      Font3DTexture texture = new Font3DTexture(TestTextureState.class.getClassLoader().getResource("jmetest/data/model/marble.bmp"));
        texture.applyEffect(font);
      Text3D text = font.createText("This is a test", 2.0f, 0);
      text.setLightCombineMode(LightState.OFF);
        text.updateRenderState();
        rootNode.attachChild(text);



Is there something I'm doing wrong here?  It doesn't give me that exception when I run the test, but I'm not seeing what I'm doing differently.  Is it perhaps something set in SimpleGame that is not being set here?

Forgive the quick bump on this, but I was hoping to have the new loading system done tonight.  I need some other eyes here because I'm not seeing what I'm doing wrong here.  Is there anything else explicitly necessary before an invocation of new Font3D can be called?



It looks like I'm missing a native library, but I can't imagine what it is.  However, what makes this even more strange is that the test works.  If I don't hear back from anyone I'm going to just have to go through SimpleGame and all its supers to figure out what it is that I'm missing.

Okay, very strange, but apparently I hit on a bug in my JDK 1.5 version that has since been fixed:



http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5079135



I switched to 1.6 and it works just fine.

I understand that this is a work-in-progress, and now know why logging is disabled in the test:


==== ERROR ====: The removal of edge {(real  )5(0.484375,0.21875)->4:(0.5625,-0.0),Helper:[indx:5,(0.484375,0.21875),type:REGULAR_LEFT],angle:-1.2277724} did not succeed
com.jmex.font3d.math.GeometricException: Bound two edges, one real one unreal, that is not possible in a closed polygon
at com.jmex.font3d.math.TriangulationVertex.checkAllEdges(TriangulationVertex.java:148)
at com.jmex.font3d.math.Triangulator.checkTriangulation(Triangulator.java:284)
at com.jmex.font3d.math.Triangulator.generateMonotonePolygons(Triangulator.java:250)
at com.jmex.font3d.math.Triangulator.triangulate(Triangulator.java:54)
at com.jmex.font3d.Glyph3D.triangulate(Glyph3D.java:113)
at com.jmex.font3d.Font3D.<init>(Font3D.java:125)
at com.jmex.game.state.load.LoadingGameState$1.call(LoadingGameState.java:64)
at com.jme.util.GameTask.invoke(GameTask.java:91)
at com.jme.util.GameTaskQueue.execute(GameTaskQueue.java:113)
at com.jmex.game.StandardGame.update(StandardGame.java:281)
at com.jmex.game.StandardGame.run(StandardGame.java:162)
at java.lang.Thread.run(Thread.java:619)
==== ERROR ====: The removal of edge {(real  )14(0.046875,0.71875)->13:(0.15625,0.578125),Helper:[indx:14,(0.046875,0.71875),type:START],angle:-0.90975314} did not succeed
We could find no left of {(real  )5(0.171875,0.40625)->4:(0.171875,0.625),Helper:null,angle:1.5707964}: 0.171875
We could find no left of {(real  )8(0.171875,0.328125)->7:(0.5625,0.328125),Helper:null,angle:0.0}: 0.171875
We could find no left of {(real  )9(0.171875,0.078125)->8:(0.171875,0.328125),Helper:null,angle:1.5707964}: 0.171875
EDGE: {(real  )14(0.046875,0.71875)->13:(0.15625,0.578125),Helper:[indx:14,(0.046875,0.71875),type:START],angle:-0.90975314}:0.28993058
EDGE: {(real  )1(0.078125,0.71875)->0:(0.078125,-0.0),Helper:[indx:4,(0.171875,0.625),type:SPLIT],angle:-1.5707964}:0.078125
EDGE: {(real  )14(0.046875,0.71875)->13:(0.15625,0.578125),Helper:[indx:14,(0.046875,0.71875),type:START],angle:-0.90975314}:0.35069442
EDGE: {(real  )1(0.078125,0.71875)->0:(0.078125,-0.0),Helper:[indx:6,(0.5625,0.40625),type:REGULAR_RIGHT],angle:-1.5707964}:0.078125
EDGE: {(real  )14(0.046875,0.71875)->13:(0.15625,0.578125),Helper:[indx:14,(0.046875,0.71875),type:START],angle:-0.90975314}:0.54513884
EDGE: {(real  )1(0.078125,0.71875)->0:(0.078125,-0.0),Helper:[indx:8,(0.171875,0.328125),type:SPLIT],angle:-1.5707964}:0.078125
Edge1:{(real  )12(0.171875,0.671875)->4:(0.171875,0.625),Helper:null,angle:-1.5707964}
Edge2:{(unreal)18(0.21875,0.578125)->12:(0.171875,0.671875),Helper:null,angle:2.0344439}

ERROR in char: (202:

While I'm spitting up information about Font3D, it also has direct ties to OpenGL thread so it must be instantiated there.

Bumping this one, with jME 0.11 and JDK 6 there are still the same Errors.



jmetest.text.Test3DFlatText



It seems to work fine, but it generates lots of warnings.






Unfortunately this is something that I think none of the developers ever touch so it hasn't gotten the attention it deserves yet.  I fear we're going to have to make a lot of sweeping changes before the text support is where we want it.  Anyone willing to spend the time to either fix what's there or create something that works better would be very welcome to it.



This is definitely something that needs to be re-evaluated in addition to support for vector fonts.

Java3D does a good job with 3D text, is that what we are aiming at here? If so, then I will give it a try.

If I recall that is one of the reasons this came about is because Java3D converts were asking about the functionality.  However, it would be nice if you specified 0.0f depth then it would be flat 2D text that can be used in the scene.