Basically what i intent to do is to allow each race of enemies e.g golems to have unique appearance/skin so that the user doesnt get so bored when he fights the same enemy type.
Ok here is now my question :
how do i change u-v texture coordinates of a face/Vertex in Jme ?
Another identical mesh is created that looks like being rotated 180 degrees along X axis. But its not symmetric because you see its back instead of its chest. I tried rotating afterwords but it didn’t help.
Questions :
Mirroring operation is done just by scaling by (-1,1,1) right ?
flipping normals is done by multiplying by -1 ?
Can i apply a Matrix transformation to a node ? i looked at the classes that use matrix4f but there are no methods that use it for that reason in Scene package.
Im not sure, But I think this one should mirror the array…
But if thats not what you want, then I suggest that you still make a new uvArray for storing the data. Do not edit the same ur using as source, it will give unexpected results i think…
@tralala Just by looking at the pictures you posted it seems you are still looking at normals that need to be inverted, the first pic of the three you posted shows this: Left side probably correct, right side inversed normals. I think your way of flipping normals is incorrect, judging the shading of the model in that picture. Look at the bright and dark parts of the left and right arm, left has dark under, right has dark up. That indicates the faces on the other end of the arm are used, you are looking through the front and see the inner side of the back instead. As a result, you see the textures from the other side of the model, which appears a 180 degree turn. I think you should not touch the texture coordinates, try flipping those normals in another way or skip it and check for changes.
By the way, that black tear in the middel is supposed to be there? Could be an anomaly from the same problem, looking through the model and at the other end end up having the back side of another face, thus getting through again, but that’s hard to spot on this pic.
when i exported the model i didnt cap the holes in the middle, because i though jme will automatically fix them, like 3d studio max does. Do i have to weld them in Jme?
it could be the normals, but from the picture with white material we can see they are ok.
i will refresh my maths so that i can flip the uvs, i expect today to fix it.
When i press the ‘z’ button it is supposed to rotate the uv texture coordinates by 0.01. I tried this to find the correct uv rotation/translation/scale for my model.
i try to change the uv’s in simpleUpdate. However it throws this exception:
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.UnsupportedOperationException: Data has already been sent. Cannot setupData again.
at com.jme3.scene.VertexBuffer.setupData(VertexBuffer.java:465)
at com.jme3.scene.Mesh.setBuffer(Mesh.java:873)
at com.jme3.scene.Mesh.setBuffer(Mesh.java:879)
at max.TestSymmetry.flipUV(TestSymmetry.java:146)
at max.TestSymmetry.simpleUpdate(TestSymmetry.java:411)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:248)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:173)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.lang.Thread.run(Thread.java:662)
I dont understand why this happen. SimpleUpdate is called only once per update so why does it throw an exception