Hi guys,
I have a problem trying to scale the texture for a .j3o mesh. Here’s the snippet:
Spatial myModel;
myModel = assetManager.loadModel("Models/MyModel/Generic.j3o");
((Geometry)myModel).getMesh().scaleTextureCoordinates(new Vector2f(2.5f, 2.5f));
I think the code above should be correct (I am new to Java and JMonkey), but the compiler says:
“… ClassCastException: com.jme3.scene.Node cannot be cast to com.jme3.sceneGeometry”
-
I can’t undestand why, because I have seen some JMonkey examples where this is a normal operation es.: http://hub.jmonkeyengine.org/t/how-to-properly-scale-uv-texture-coordinates-dynamically-loaded-j3o-meshes/30123
-
and I can’t understand why the compiler says “…Node cannot be cast…” because myModel variable is Spatial, not Node.
Thank you very much for you attention