Custom Characters
Custom Characters
I was wondering if anyone had tried to make a function in a game using Irrlicht that would allow the player to customize their character's avatar. I need to know how would I go about doing this I'm not sure if all you have to do is make separate models and skins then pre-load then then as the player switched through the different parts then they are attached to the base model in a mesh viewer. I could really use some help with this.
DayStar
If it's just the colours you're changing then that's just done by maybe vertex colours (with some editing to how vertex colours are used as they're sometimes ignored) or changing the colours of the texture directly, maybe creating a new texture for the user's specific setup they want.
Do you also want to know about attaching things like helmets, armour, weapons etc...? That's what i thought your original post was more about.
Do you also want to know about attaching things like helmets, armour, weapons etc...? That's what i thought your original post was more about.
The original post did include attaching things to the person too, would you be able to help me with that?JP wrote:If it's just the colours you're changing then that's just done by maybe vertex colours (with some editing to how vertex colours are used as they're sometimes ignored) or changing the colours of the texture directly, maybe creating a new texture for the user's specific setup they want.
Do you also want to know about attaching things like helmets, armour, weapons etc...? That's what i thought your original post was more about.
DayStar
In way, never done it myself but it's been talked about a lot on here and is fairly simple in principle.
The best way to do it is to use a model format that supports bones/joints (i.e. ms3d, x, b3d etc) and then you can connect things to the skeleton of your model, so you could attach a sword to the hand joint so your character holds it and swings it around like a sword when the arm is animated.
The best way to do it is to use a model format that supports bones/joints (i.e. ms3d, x, b3d etc) and then you can connect things to the skeleton of your model, so you could attach a sword to the hand joint so your character holds it and swings it around like a sword when the arm is animated.
In my setup I used 2 textures, one as a basic colour map, and another signifying areas which recieve custom colouring (Thats in red, blue is for reflective stuff kind of like a specular map and green is for dirt), look at this example here:
http://irrlichtirc.g0dsoft.com/BlindSide/modMap.JPG
Then in the shader I apply the "ModMap" with the same texture coordinates as the base texture and lerp between the custom set colour and the base texture colour based on the red value of the ModMap.
This allows me to create many different coloured ships like so:
http://irrlichtirc.g0dsoft.com/BlindSide/ingame.JPG
A very similar approach can be used for your requirements, eg. Marking hair and other stuff with a custom colour that can be changed.
Changing the vertex colour is also a good idea, another simpler approach is to just have seperate meshes for the hair and the body and other modifiable areas.
To attach meshes you gotta grab the bonescenenode and do a setParent() on the weapon.
Good luck
http://irrlichtirc.g0dsoft.com/BlindSide/modMap.JPG
Then in the shader I apply the "ModMap" with the same texture coordinates as the base texture and lerp between the custom set colour and the base texture colour based on the red value of the ModMap.
This allows me to create many different coloured ships like so:
http://irrlichtirc.g0dsoft.com/BlindSide/ingame.JPG
A very similar approach can be used for your requirements, eg. Marking hair and other stuff with a custom colour that can be changed.
Changing the vertex colour is also a good idea, another simpler approach is to just have seperate meshes for the hair and the body and other modifiable areas.
To attach meshes you gotta grab the bonescenenode and do a setParent() on the weapon.
Good luck
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net