Is it efficient to share vertice FloatBuffer between TriMeshes


I am fairly new to JMonkeyEngine and I have some questions.

I am creating a "floor" out of hexagons using TriMesh(es) and I am wondering if it is better to create all hexagons in the floor using the same vertice float buffer or if I should create a new float buffer for each hexagon? It seemed easier to create a single floatbuffer for the floor (keeping track of what x,y,z shifting are needed), and intuitiveley it seems more efficient then allocating many smaller buffers. However since I am not to familiar with JMonkeyEngine internals I thought I'd ask: Is this approach more efficient or should each TriMesh (Hexagon) be created with its own vertice-,normals-, colors- and texture FloatBuffers? I also just noticed that the BoundingBox for the Hexagon seem to envelop all vertices. Anyway to get the BoundingBox to only wrap around the vertices accessed by the indices of the Hexagons?

Another quick question I have is how I should go about highlighting the outer edges of my hexagons? Do I need some kind of shader or is there some easier way?



take a look at SharedMesh.


Reworked my code to use SharedMesh instead.