Hi,
I am using custom meshes as described in :
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes
What I want is to change the texture coordinates of my mesh. At the moment i recreate the whole mesh and set it on the Geometry again.
The problem is, that it only sporadically updates the new texture. Only if i the vertices also changed the Mesh is updated correctly.
Can i somehow force the redraw of the Mesh/Geometry?
[java]
if (faces[xFace]) {
vertices.add(b);
vertices.add(f);
vertices.add(d);
vertices.add(h);
normals.add(xAxis);
normals.add(xAxis);
normals.add(xAxis);
normals.add(xAxis);
Vector2f[] cords = tex.getTextureCoordinates(type.getTexturetype(), 0);
texCoord.add(cords[0]);
texCoord.add(cords[1]);
texCoord.add(cords[2]);
texCoord.add(cords[3]);
indexes.add(verticesSize + 2);
indexes.add(verticesSize + 0);
indexes.add(verticesSize + 1);
indexes.add(verticesSize + 1);
indexes.add(verticesSize + 3);
indexes.add(verticesSize + 2);
}
[/java]
[java]
public void updateGeometry() {
this.geometry.setMesh(getMesh());
}
[/java]