Problem with walking

Hello, I have this problem:

I have a character created with MakeHuman, exported it to blender and then passed it on to jmonkey ogre, the problem is when I try to move or rotate, simply I can not or do not know how, this is the code:



public class Main extends SimpleApplication{



public static void main(String[] args) {

Main app = new Main();

app.start();

}



Node humano;



@Override

public void simpleInitApp() {

/* SIMPLEINITAPP SE EJECUTA UNA SOLA VEZ, AL INCIO*/

humano = (Node) assetManager.loadModel(“Models/Human.mesh.xml”);

/* aca uso las propiedades de las imagenes, escalar, rotar,y la otra*/

humano.setLocalScale(0.05f);

humano.rotate(0.0f, 0.0f, 0.0f);

humano.setLocalTranslation(0.0f, 0.0f, 0.0f);

humano.setLocalScale(0.5f);

rootNode.attachChild(humano);

DirectionalLight dl = new DirectionalLight();

dl.setDirection(new Vector3f(-0.1f, -1f, -1).normalizeLocal());

rootNode.addLight(dl);



/*CARGO EL MAPA (EN ESTE CASO LA CIUDAD) */

assetManager.registerLocator(“town.zip”, ZipLocator.class.getName());

Spatial gameLevel = assetManager.loadModel(“main.scene”);

gameLevel.setLocalTranslation(0, -5.2f, 0);

gameLevel.setLocalScale(2);

rootNode.attachChild(gameLevel);

}



which would be the way to do this walk? hize blender because the movements, but can not find how to apply

another question, how load the skeleton?

the problem is when I try to move or rotate, simply I can not or do not know how


You aren't rotating anything:

[java]
humano.rotate(0.0f, 0.0f, 0.0f);
[/java]

I rotates the node 0 degrees at x, y and z axis. If you are wanting to set its rotation to 0, 0, 0, then set its local rotation:

[java]
humano.setLocalRotation(new Quartenion(0, 0, 0, 1));
[/java]

You'll need to read this: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math_for_dummies and this : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies

which would be the way to do this walk? hize blender because the movements, but can not find how to apply


Do the character "walk in place" animation in blender, create a character control for the node in jme, and move it by using the appropriate method. Look at the TestWalkingChar.java, it can be found by creating a Jme Tests project via "new project---->Jme Tests".

another question, how load the skeleton?


By requesting the model's anim control node.getControl(AnimControl.class), the TestWalkingChar.java is a good example for this too.
Also, all this questions can be found on FAQ.
1 Like