I don’t know if you’ll understand better with this, but here’s a drawing of what the complete problem is.
N = Normal
T = Tangeant
Red dots = Vertices
Orange smileys = Texture

So basically, as you can see, I’d like a way to make it so the GLSL shader draws the texture aligned with a direction vector, like for instance, the XZ normal vector (or as I said before, Y-axis rotation like a billboard). The problem I’m facing is more complex than just rotating the UV coordinate. The vertices sent to the GPU are coming from a triangle strip and I found out after half an hour of head scratching that the texture coordinates are sometimes sent facing Z+ sometimes X- sometimes Z- you get the idea, it’s pretty much random, probably based on the triangle strip vertex buffer indexes being reused by the adjacent triangles.
Basically, what I’m thinking now is that I could overwrite the texCoord in the vertex FloatBuffer leaving the GLSL shader absolutely unchanged. I proved it could work by manually inputing new texCoords making the texture have the correct orientation. It’s just not something I can manually set as a constant because as I said all triangles have random vertex order, meaning I have to find a way to compute the texCoord for each vertex.
At the moment it looks like this:

Do you think you could help on this?
EDIT: Following up with the above (same post) theory I posted, I have found an almost 100% working solution using for instance the face normal as a direction vector for the texture. It’s probably not optimal and could highly benefit from the hundreds of GPU cores to calculate this instead… or not, maybe it’s better that it’s calculated once by the CPU and set in the buffer once and for all, especially if these triangles are static in the scene I suppose, but anyhow, here’s what I tried and it seems like it’s almost perfect, I found only 2 triangles out of 100 that are not good, but I think I can fix the formula, I probably inverted the (?
or something. I have to go to bed now, I’m sleeping on my keyboard 
[java]
Vector2f[] texCoord = new Vector2f[3];
float max_y = Math.max(vertices[0].y, Math.max(vertices[1].y, vertices[2].y));
texCoord[0] = max_y == vertices[0].y ? new Vector2f(1,0) : (max_y == vertices[1].y ? new Vector2f(0,1) : new Vector2f(0,0));
texCoord[1] = max_y == vertices[0].y ? new Vector2f(0,0) : (max_y == vertices[1].y ? new Vector2f(1,0) : new Vector2f(0,1));
texCoord[2] = max_y == vertices[0].y ? new Vector2f(0,1) : (max_y == vertices[1].y ? new Vector2f(0,0) : new Vector2f(1,0));
triangle_mesh.setBuffer(VertexBuffer.Type.TexCoord, 2, BufferUtils.createFloatBuffer(texCoord));
[/java]