I have a mesh and wanted to reassign its texture coordinates so I started with something like this:
create new float buffer (2 floats for every vertex)
assign (“put” method) floats to the new float buffer
mesh.setBuffer(Type.TexCoord, 2, newFloatBuffer)
Is this the appropriate way to do it? I ask because I have a problem with the mesh not showing the way I want it to sometimes, and thought this might be the problem.
@Empire Phoenix I took your advice and used mesh.getFloatBuffer(…) and wrote over the it. I don’t think the rewind is necessary though, since it worked without it. I used the “put” method to write into the FloatBuffer.
@nehon updateModelBound() didn’t seem to do anything.
After many failed attempts, I finally used mesh.getBuffer(Type.TexCoord).setUpdateNeeded(), which seemed to solve some of the problem. The model always changes the right way, but I’ve ran into another issue. It affects all of the same models. For example, if I change the buffer of a rock model, it also changes a different cloned rock model.