I’ve seen this many times at the forums, but it is not working for me.
I want to Scroll a texture from a material.
First get the geometry from the j3o, so i open scene editor and find geometry name:
Geometry geom = j3o_Model.getChild("Geometry_Name");
I saw this a lot of times and people says it works… For me “getchild” shows red underline and I can’t use this.
This is the Model in scene editor:
Can somebody tell me what’s wrong? maybe i’m making a syntax mistakes as i’m a complete noob in java and Jmonkey engine.
Once I get the geometry, I could use this to move vertex positions (I hope):
public void MoveTextureUV(Mesh meshload, float moveUOffset){
VertexBuffer uv = meshload.getBuffer(Type.TexCoord);
float[] uvArray = BufferUtils.getFloatArray((FloatBuffer) uv.getData());
for (int i = 0; i < uvArray.length; i += 2)
uvArray[i] += moveUOffset; //moves u.
uv.updateData(BufferUtils.createFloatBuffer(uvArray));
}
Thanks.