.B3D: How to make character body out of several parts
.B3D: How to make character body out of several parts
Hey, everybody.
I am planning a game that uses models saved as .b3d files. I was wondering how, with this format, one could make character bodies out of individual parts (i.e. head, torso, legs, arms, hands, and feet) rigged to the same skeleton. I know this is a common practice in 3D games with a lot of character customization, but I am looking for more information on how this would be done specifically in Irrlicht using the .b3d format.
I have tried looking for information on the subject before asking, and it was, quite honestly, a fruitless endeavor. I can't really describe what I am trying to do in a way that my search engine understands, if that makes any sense.
I am planning a game that uses models saved as .b3d files. I was wondering how, with this format, one could make character bodies out of individual parts (i.e. head, torso, legs, arms, hands, and feet) rigged to the same skeleton. I know this is a common practice in 3D games with a lot of character customization, but I am looking for more information on how this would be done specifically in Irrlicht using the .b3d format.
I have tried looking for information on the subject before asking, and it was, quite honestly, a fruitless endeavor. I can't really describe what I am trying to do in a way that my search engine understands, if that makes any sense.
Re: .B3D: How to make character body out of several parts
Irrlicht won't do this.
Are the body parts rigid or do you want to skin them? If they are rigid, you can load them separately into a hierarchy and apply the transformations to each part.
Are the body parts rigid or do you want to skin them? If they are rigid, you can load them separately into a hierarchy and apply the transformations to each part.
Re: .B3D: How to make character body out of several parts
Skinned. Skeletal animation is the only kind with which I have even a speck of experience.
What I'm wanting to do is make it so that I can put different pieces of armor (gloves, boots, etc.) on a character, without having to make a different model for every glove/boot/armor combination. I also want to avoid possible clipping.
I read that you can have a .b3d file with the model in t-pose and then individual .b3d files for the animations. I also read that you can use a single animation file for multiple models, if they use the same skeleton. If those statements are true, then I don't see how having a body composed of several pieces rigged to the same skeleton would be impossible.
Or am I going in the wrong direction entirely?
What I'm wanting to do is make it so that I can put different pieces of armor (gloves, boots, etc.) on a character, without having to make a different model for every glove/boot/armor combination. I also want to avoid possible clipping.
I read that you can have a .b3d file with the model in t-pose and then individual .b3d files for the animations. I also read that you can use a single animation file for multiple models, if they use the same skeleton. If those statements are true, then I don't see how having a body composed of several pieces rigged to the same skeleton would be impossible.
Or am I going in the wrong direction entirely?
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: .B3D: How to make character body out of several parts
Greetings Alopex,
If you intend to manipulate the mesh directly, I recommend that you first become familiar with Irrlicht's mesh system. The files IMesh.h, IAnimatedMesh.h, and ISkinnedMesh.h can start you off. All meshes in Irrlicht are loaded into mesh classes that inherit from IAnimatedMesh and have mesh buffers that can be accessed with IMeshBuffer via IMesh::getMeshBuffer(u32). About the only reliable part in the abstract interface since the implementations take some liberties in organization "behind the scenes". That makes disassembling a mesh tricky if you don't know how it's stored.
It'd be better to simply load your objects as nodes and simply make them child nodes (of the main mesh scene node) that have animators that force them to follow the orientations of the main mesh buffers (of arms and legs, assuming those are animated). All animators inherit from ISceneNodeAnimator, and there are some simple ones like a flying and follow-path animator. I'm sure it'll be easier to do it this way.
If you intend to manipulate the mesh directly, I recommend that you first become familiar with Irrlicht's mesh system. The files IMesh.h, IAnimatedMesh.h, and ISkinnedMesh.h can start you off. All meshes in Irrlicht are loaded into mesh classes that inherit from IAnimatedMesh and have mesh buffers that can be accessed with IMeshBuffer via IMesh::getMeshBuffer(u32). About the only reliable part in the abstract interface since the implementations take some liberties in organization "behind the scenes". That makes disassembling a mesh tricky if you don't know how it's stored.
It'd be better to simply load your objects as nodes and simply make them child nodes (of the main mesh scene node) that have animators that force them to follow the orientations of the main mesh buffers (of arms and legs, assuming those are animated). All animators inherit from ISceneNodeAnimator, and there are some simple ones like a flying and follow-path animator. I'm sure it'll be easier to do it this way.
Re: .B3D: How to make character body out of several parts
Well, I guess I have a lot more research to do. Regardless, at least I have a direction to go now.
Thank you.
Thank you.
-
- Posts: 105
- Joined: Mon Jun 02, 2014 2:32 am
- Location: Washington, D.C.
- Contact:
Re: .B3D: How to make character body out of several parts
I've been toying with this idea as well.
One approach would be to create a "skeleton" mesh, which is invisible to the naked eye, and have assigned bones for the different customizable limbs (i.e. head bone, arm bone, foot bone, etc.).
Then you would simply look for those bones and bind child meshes to them. Irrlicht's mesh classes should allow you to scan for specific bones if I'm not mistaken... >_>
Let us know whether or not you succeed!
One approach would be to create a "skeleton" mesh, which is invisible to the naked eye, and have assigned bones for the different customizable limbs (i.e. head bone, arm bone, foot bone, etc.).
Then you would simply look for those bones and bind child meshes to them. Irrlicht's mesh classes should allow you to scan for specific bones if I'm not mistaken... >_>
Let us know whether or not you succeed!
My blog: http://fsgdp.wordpress.com "The Free Software Game Development Pipeline"
Re: .B3D: How to make character body out of several parts
You could just export all the body parts, each with the full skeleton and animation. Once they are arranged in a scene-node hierarchy, they should perform as expected.
(You could export the animation once and use 'useAnimationFrom'.)
(You could export the animation once and use 'useAnimationFrom'.)
Re: .B3D: How to make character body out of several parts
I used this approach with the Monsters game, but md3 was designed to do so, it has explicit attachment points between the torso and legs, torso and head, and hand and gun.
Re: .B3D: How to make character body out of several parts
Thank you, Mongoose.
I did exactly that, and It appears to work perfectly.
I did exactly that, and It appears to work perfectly.
-
- Posts: 105
- Joined: Mon Jun 02, 2014 2:32 am
- Location: Washington, D.C.
- Contact:
Re: .B3D: How to make character body out of several parts
@mongoose7 @alopex
Is there a way either of you could document how this process works, or elaborate more upon it? This subject is something I'm interested in learning more about.
Thank you!
Is there a way either of you could document how this process works, or elaborate more upon it? This subject is something I'm interested in learning more about.
Thank you!
My blog: http://fsgdp.wordpress.com "The Free Software Game Development Pipeline"
Re: .B3D: How to make character body out of several parts
I definitely intend to document this, in some fashion or another, once I figure it all out.
Edit: I just figured out how to cast an animated mesh to a skinned mesh. Borrowing code from Mel:
scene::IAnimatedMesh* mesh;
mesh = smgr->getMesh("yourMesh.X");//can be B3D or MS3D also.
scene::ISkinnedMesh* skinMesh;
Edit: I just figured out how to cast an animated mesh to a skinned mesh. Borrowing code from Mel:
scene::IAnimatedMesh* mesh;
mesh = smgr->getMesh("yourMesh.X");//can be B3D or MS3D also.
scene::ISkinnedMesh* skinMesh;
Re: .B3D: How to make character body out of several parts
A skinned mesh has a mesh and a skeleton. The skeleton consists of bones. Bones are just (local) transformations and affected vertices. So for an animation, start at the root. Transform the root vertices by the root transformation. Move down the skeleton by composing the transformations and apply the composed transformation to the bone's vertices.
Note that composing the local transformations is just what happens in a scene-node hierarchy. So, if the bones (transformations) only affect the local body part, it should work.
In general, though, the area of effect of a local transformation is general. And this is complicated by weights, where one vertex is subject to the motion of a number of bones.
Note that composing the local transformations is just what happens in a scene-node hierarchy. So, if the bones (transformations) only affect the local body part, it should work.
In general, though, the area of effect of a local transformation is general. And this is complicated by weights, where one vertex is subject to the motion of a number of bones.
Re: .B3D: How to make character body out of several parts
Apart from useAnimationFrom(), is there any way I can store animations separately from my models?
Re: .B3D: How to make character body out of several parts
To my knowledge that's currently the only way.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: .B3D: How to make character body out of several parts
Export a simple mesh which contains all the animations and build a skinned mesh on the fly. It may be very tedious to program, but not impossble and gives the best results
That is if your customized parts aren't just static meshes, in that case just load them and stick them via addChildNode. On your skinned meshes give a proper name always to the bones, and export them
That is if your customized parts aren't just static meshes, in that case just load them and stick them via addChildNode. On your skinned meshes give a proper name always to the bones, and export them
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt