Render BitmapText to mesh

Hello.



Is there any standard way to add text to a box mesh if you are using JME3?



I have a map made up of cells represented by Box meshes that I am plotting a route through using A*. Right now the algorithm tends zig-zag once it gets closer to the target. The rendering is





This bring me to my problem, I need some way to add a calculated text string to the cell, in this case the pathfinding values.



As far as I can tell there is two possible ways:

  1. create a BufferedImage → ByteBuffer → com.jme3.texture.Image → com.jme3.texture.Texture2D and add that to the material somehow.
  2. Use a BitmapText and place it right above the surface of the floor.



    Which one is the best/recommended way?



    I found TestMultiFaceBox.java but that code no longer works due to JME3 changes.

See TestBitmapText3D

Momoko_Fan said:
See TestBitmapText3D

So you think option 2 is the way to go?

I ended up creating a node for each cell with the box geometry and the BitmapText attached. Now I just need to figure out some way to merge the separate block into a larger block. I think that is what is killing my rendering performance.