i have tried everything but i just cannot do it so i have an Idea:
i send you my Model and you code something to animate it and explain how you did it
i have tried everything but i just cannot do it so i have an Idea:
i send you my Model and you code something to animate it and explain how you did it
How about you start off with some easy tutorial first? Like animation and modeling is one thing, and jME is another. You can forget one and focus on the other while you get the hang of things.
Like forget animations and modeling for now, do it in easy mode like following this https://youtu.be/_376N1AA5xw?si=oAvZZoKMEb6PP3x1. Or some other tutorial of choice. Or import any ready model from any service.
And just play with those, focus to learn jME. Or then if your goal is to be a modeler and animator, then maybe switch to another engine that has a tad easier pipeline.
okay i got it now a tutorial for the Code would be helpfull
If you have a short attention span, this guy is fun to watch and very educational:
I’ve learned a ton about Blender just watching his 10 minute modeling challenges.
From there, it’s pretty straight forward to export gltf and load it into JME.
How to Download a Mixamo Walking Animation and Import it into Blender for JMonkeyEngine
Here’s a step-by-step guide on how to download a Mixamo walking animation, import it into Blender, and export it as a GLB file for use in JMonkeyEngine:
Here’s a step-by-step guide on how to download a Mixamo walking animation and integrate it into your project:
1. Prepare Your Mixamo Account and Download the Model:
2. Import the FBX into Blender:
3. Prepare the Animation:
4. Export as GLB:
5. Import the GLB into JMonkeyEngine:
Spatial
node to hold the imported model.Spatial
node.AnimationComposer
node and attach it to the model.AnimationComposer
to play the walking animation.Here’s a basic JME3 code example to render the character animation:
// This line tells the program what package this code belongs to.
// Think of a package like a folder that groups related things together.
package runnergame;
// This line imports (brings in) functionality from other code libraries.
// These libraries help us build the game.
import com.jme3.anim.AnimComposer; // This helps us control animations.
import com.jme3.app.SimpleApplication; // This is the foundation of our game.
import com.jme3.light.DirectionalLight; // This helps us add lighting to the scene.
import com.jme3.math.ColorRGBA; // This helps us define colors.
import com.jme3.math.Vector3f; // This helps us define positions and directions in 3D space.
import com.jme3.scene.Node; // This represents a group of objects in the game world.
import com.jme3.scene.SceneGraphVisitor; // This helps us walk through the scene and find specific objects.
import com.jme3.scene.Spatial; // This is a general term for any object in the game scene.
import com.jme3.scene.plugins.gltf.GltfModelKey; // This helps us load models in the GLTF format.
// This line defines a class called ModelLoader. This class is like a blueprint for creating our game.
public class ModelLoader extends SimpleApplication {
// This variable will store the animation controller for our model.
private AnimComposer animComposer;
// This is the main method, where the program starts.
public static void main(String[] args) {
// We create a new instance of our ModelLoader game and start it.
ModelLoader game = new ModelLoader();
game.start();
}
// This method is called once when the game starts. Here's where we set things up.
@Override
public void simpleInitApp() {
// This line tells the program where to find our model file.
GltfModelKey modelKey = new GltfModelKey("assets/Models/Walking_Model.glb");
// This line loads the model from the file.
Node model = (Node) getAssetManager().loadModel(modelKey);
// This part searches through all the objects in our model to find the animation controller.
model.depthFirstTraversal(new SceneGraphVisitor() {
@Override
public void visit(Spatial spatial) {
// If the current object has an animation controller, we store it.
if (spatial.getControl(AnimComposer.class) != null) {
animComposer = spatial.getControl(AnimComposer.class);
}
}
});
// Now that we have the animation controller, we attach it to the model.
model.addControl(animComposer);
// This line tells the animation controller to play the first animation it finds.
animComposer.setCurrentAction(animComposer.getAnimClipsNames().iterator().next());
// We add the model to the game world.
rootNode.attachChild(model);
// This line creates a light source that shines from above and makes the scene brighter.
DirectionalLight light = new DirectionalLight(Vector3f.UNIT_XYZ.mult(-1), ColorRGBA.White.mult(3));
rootNode.addLight(light);
}
}
Remember to adjust the file paths and animation names according to your specific project setup.
By following these steps, you can successfully import and use Mixamo animations in your JMonkeyEngine projects.
Is this AI prompt? If so, maybe also hint the OP that AI can be also used to query stuff.
Yes, This is an AI response
At least tested?